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

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) ===
Signed-off-by: Donghwa Jeong <[email protected]>
From 6666b28fbc5fede8b936c026d19f7c675d2ecfb7 Mon Sep 17 00:00:00 2001
From: Donghwa Jeong <[email protected]>
Date: Fri, 15 Jun 2018 11:11:48 +0900
Subject: [PATCH] storage: Resource leak

Signed-off-by: Donghwa Jeong <[email protected]>
---
 src/lxc/storage/storage_utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c
index 6570bb88e..fa8dfaf41 100644
--- a/src/lxc/storage/storage_utils.c
+++ b/src/lxc/storage/storage_utils.c
@@ -93,8 +93,10 @@ char *dir_new_path(char *src, const char *oldname, const 
char *name,
 
                /* copy text up to oldname */
                retlen = strlcpy(p, src, p2 - src);
-               if (retlen >= p2 - src)
+               if (retlen >= p2 - src) {
+                       free(ret);
                        return NULL;
+               }
 
                /* move target pointer (p) */
                p += p2 - src;
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to