[CRIU] [PATCH 5/9] cr-dump: fix memory leak in fill_zombies_pids

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


CID 996204 (#1 of 1): Resource leak (RESOURCE_LEAK)
11. leaked_storage: Variable "ch" going out of scope leaks the storage it points to.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cr-dump.c b/cr-dump.c
index ad06d4f..f11bfcc 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1304,6 +1304,8 @@ static int fill_zombies_pids(struct pstree_item *item)
 		BUG_ON(i == nr);
 	}
 
+	xfree(ch);
+
 	return 0;
 }
 
-- 
1.7.11.7



More information about the CRIU mailing list