[lxc-devel] [lxc/master] coverity: #1425811
2xsec on Github
lxc-bot at linuxcontainers.org
Fri Jun 8 13:05:37 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 371 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180608/a06f87df/attachment.bin>
-------------- next part --------------
From aa7c5841bd503942bd712367a2f35d987e934b2d Mon Sep 17 00:00:00 2001
From: Donghwa Jeong <dh48.jeong at samsung.com>
Date: Fri, 8 Jun 2018 22:03:37 +0900
Subject: [PATCH] coverity: #1425811
Resource leak
Signed-off-by: Donghwa Jeong <dh48.jeong at samsung.com>
---
src/lxc/confile.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index d07ada29c..5227c70c5 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -628,8 +628,12 @@ static int set_config_net_ipv4_address(const char *key, const char *value,
/* No prefix specified, determine it from the network class. */
if (prefix) {
ret = lxc_safe_uint(prefix, &inetdev->prefix);
- if (ret < 0)
+ if (ret < 0) {
+ free(inetdev);
+ free(list);
+ free(addr);
return -1;
+ }
} else {
inetdev->prefix = config_ip_prefix(&inetdev->addr);
}
More information about the lxc-devel
mailing list