[lxc-devel] [lxc/master] Fixed resource leak in userns_exec_full()

simos on Github lxc-bot at linuxcontainers.org
Tue May 15 00:33:51 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 1011 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180515/bf876708/attachment.bin>
-------------- next part --------------
From d3ee1995937641fa793163faaf6c3459e92af872 Mon Sep 17 00:00:00 2001
From: Simos Xenitellis <simos.lists at googlemail.com>
Date: Tue, 15 May 2018 00:19:12 +0000
Subject: [PATCH] Fixed resource leak in userns_exec_full()

coverity: #1425836

Signed-off-by: Simos Xenitellis <simos.lists at googlemail.com>
---
 src/lxc/conf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index e854b8b03..48f4fef38 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4082,8 +4082,10 @@ struct lxc_list *get_minimal_idmap(struct lxc_conf *conf)
 	return idmap;
 
 on_error:
-	if (idmap)
+	if (idmap) {
 		lxc_free_idmap(idmap);
+		free(idmap);
+	}
 	if (container_root_uid)
 		free(container_root_uid);
 	if (container_root_gid)


More information about the lxc-devel mailing list