]> git.proxmox.com Git - lxc.git/blame - debian/patches/fixes/0007-tools-utils-free-memory-on-error.patch
bump version to 3.0.0-3
[lxc.git] / debian / patches / fixes / 0007-tools-utils-free-memory-on-error.patch
CommitLineData
99be5c8c
WB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: C0deAi <benjamin.bales@assrc.us>
3Date: Fri, 6 Apr 2018 12:56:50 -0400
4Subject: [PATCH] tools/utils: free memory on error
5
6Closes #2262.
7
8Signed-off-by: C0deAi <techsupport@mycode.ai>
9Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
10---
11 src/lxc/tools/tool_utils.c | 5 ++++-
12 1 file changed, 4 insertions(+), 1 deletion(-)
13
14diff --git a/src/lxc/tools/tool_utils.c b/src/lxc/tools/tool_utils.c
15index ca325456..71e5036b 100644
16--- a/src/lxc/tools/tool_utils.c
17+++ b/src/lxc/tools/tool_utils.c
18@@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
19 return -1;
20
21 dent->elem = parse_line(arg);
22- if (!dent->elem)
23+ if (!dent->elem) {
24+ free(dent);
25 return -1;
26+ }
27+
28 lxc_list_add_tail(defines, dent);
29 return 0;
30 }
31--
322.11.0
33