Commit ab59e7d3 authored by Pavel Emelyanov's avatar Pavel Emelyanov

pipes: Plug memory leak on pipd data image EOF

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 906f0813
...@@ -40,13 +40,13 @@ static void show_saved_pipe_fds(struct pipe_info *pi) ...@@ -40,13 +40,13 @@ static void show_saved_pipe_fds(struct pipe_info *pi)
int collect_pipe_data(int img_type, struct pipe_data_rst **hash) int collect_pipe_data(int img_type, struct pipe_data_rst **hash)
{ {
int fd, ret; int fd, ret;
struct pipe_data_rst *r = NULL;
fd = open_image_ro(img_type); fd = open_image_ro(img_type);
if (fd < 0) if (fd < 0)
return -1; return -1;
while (1) { while (1) {
struct pipe_data_rst *r;
u32 off; u32 off;
ret = -1; ret = -1;
...@@ -73,6 +73,11 @@ int collect_pipe_data(int img_type, struct pipe_data_rst **hash) ...@@ -73,6 +73,11 @@ int collect_pipe_data(int img_type, struct pipe_data_rst **hash)
r->pde->pipe_id, ret); r->pde->pipe_id, ret);
} }
if (r) {
xfree(r->pde);
xfree(r);
}
close(fd); close(fd);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment