The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2267

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===

From 125a2e044cae5528b930d2b914632770d04e7059 Mon Sep 17 00:00:00 2001
From: C0deAi <benjamin.ba...@assrc.us>
Date: Fri, 6 Apr 2018 11:30:06 -0400
Subject: [PATCH 1/3] lxc init: remove dead code

Value stored is never read.

Closes #2262.

Signed-off-by: C0deAi <techsupp...@mycode.ai>
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/cmd/lxc_init.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/lxc/cmd/lxc_init.c b/src/lxc/cmd/lxc_init.c
index a0dabb66a..9168c7878 100644
--- a/src/lxc/cmd/lxc_init.c
+++ b/src/lxc/cmd/lxc_init.c
@@ -150,7 +150,6 @@ static void prevent_forking(void)
                        SYSERROR("Failed to write to \"%s\"", path);
 
                close(fd);
-               fd = -1;
                break;
        }
 

From 55d83a7c723a646f044d337e63481004c36a3352 Mon Sep 17 00:00:00 2001
From: C0deAi <benjamin.ba...@assrc.us>
Date: Fri, 6 Apr 2018 12:46:53 -0400
Subject: [PATCH 2/3] storage/rsync: free memory on error

Closes #2262.

Signed-off-by: C0deAi <techsupp...@mycode.ai>
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/storage/rsync.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/storage/rsync.c b/src/lxc/storage/rsync.c
index c3080a568..83871ae80 100644
--- a/src/lxc/storage/rsync.c
+++ b/src/lxc/storage/rsync.c
@@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
                return -1;
 
        ret = snprintf(s, l, "%s", src);
-       if (ret < 0 || (size_t)ret >= l)
+       if (ret < 0 || (size_t)ret >= l) {
+               free(s);
                return -1;
+       }
 
        s[l - 2] = '/';
        s[l - 1] = '\0';

From 74269047b49ff3fb9cd152274b2e817a0ad68af6 Mon Sep 17 00:00:00 2001
From: C0deAi <benjamin.ba...@assrc.us>
Date: Fri, 6 Apr 2018 12:56:50 -0400
Subject: [PATCH 3/3] tools/utils: free memory on error

Closes #2262.

Signed-off-by: C0deAi <techsupp...@mycode.ai>
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/tools/tool_utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lxc/tools/tool_utils.c b/src/lxc/tools/tool_utils.c
index ca325456a..71e5036be 100644
--- a/src/lxc/tools/tool_utils.c
+++ b/src/lxc/tools/tool_utils.c
@@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char 
*arg)
                return -1;
 
        dent->elem = parse_line(arg);
-       if (!dent->elem)
+       if (!dent->elem) {
+               free(dent);
                return -1;
+       }
+
        lxc_list_add_tail(defines, dent);
        return 0;
 }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to