[lxc-devel] [lxc/master] start: fix handler memory leak at lxc_init failed

lifeng68 on Github lxc-bot at linuxcontainers.org
Wed Jun 5 03:33:17 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190604/c777eb4b/attachment.bin>
-------------- next part --------------
From 39cb2d9ee8f07cfe885defc9794d14799923aa0c Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68 at huawei.com>
Date: Wed, 5 Jun 2019 00:44:17 -0400
Subject: [PATCH] start: fix handler memory leak at lxc_init failed

Signed-off-by: LiFeng <lifeng68 at huawei.com>
---
 src/lxc/start.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index 51969697e7..d6477fd1fc 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -2008,7 +2008,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
 	ret = lxc_init(name, handler);
 	if (ret < 0) {
 		ERROR("Failed to initialize container \"%s\"", name);
-		return -1;
+		goto out_fini_nonet;
 	}
 	handler->ops = ops;
 	handler->data = data;


More information about the lxc-devel mailing list