[CRIU] [PATCH 7/8] ipc_ns: don't leak memory

Andrey Vagin avagin at openvz.org
Fri Oct 31 07:50:49 PDT 2014


CID 73377: Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable values going out of scope leaks the storage
it points to.

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

diff --git a/ipc_ns.c b/ipc_ns.c
index 1e49855..3bb085d 100644
--- a/ipc_ns.c
+++ b/ipc_ns.c
@@ -492,6 +492,7 @@ void ipc_sem_handler(struct cr_img *img, void *obj)
 		return;
 	}
 	pr_msg_ipc_sem_array(e->nsems, values);
+	xfree(values);
 }
 
 static void ipc_msg_data_handler(struct cr_img *img, void *obj)
-- 
1.9.3



More information about the CRIU mailing list