[CRIU] [PATCH] pie: piegen -- Fix memory leak

Cyrill Gorcunov gorcunov at openvz.org
Mon Jul 6 01:54:13 PDT 2015


 | CID 96750 (#1 of 1): Resource leak (RESOURCE_LEAK)
 | 163. leaked_storage: Variable sec_hdrs going out of scope leaks the storage it points to.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/piegen/elf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pie/piegen/elf.c b/pie/piegen/elf.c
index 3b35c4a13249..a708383bb144 100644
--- a/pie/piegen/elf.c
+++ b/pie/piegen/elf.c
@@ -504,6 +504,7 @@ int handle_elf(void *mem, size_t size)
 		}
 	}
 	pr_out("};\n");
+	free(sec_hdrs);
 	return 0;
 err:
 	free(sec_hdrs);
-- 
2.4.3



More information about the CRIU mailing list