[CRIU] [PATCH 8/9] page-pipe: fix memory leak on error path

Andrey Vagin avagin at openvz.org
Thu Apr 4 17:44:34 EDT 2013


CID 996197 (#1 of 1): Resource leak (RESOURCE_LEAK)
8. leaked_storage: Variable ppb going out of scope leaks the storage it points to.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 page-pipe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/page-pipe.c b/page-pipe.c
index 73c0744..5295839 100644
--- a/page-pipe.c
+++ b/page-pipe.c
@@ -17,6 +17,7 @@ static int page_pipe_grow(struct page_pipe *pp)
 		return -1;
 
 	if (pipe(ppb->p)) {
+		xfree(ppb);
 		pr_perror("Can't make pipe for page-pipe");
 		return -1;
 	}
-- 
1.7.11.7



More information about the CRIU mailing list