[lxc-devel] [lxc/master] lxc_mount_auto_mounts(): free memory on failure

brauner on Github lxc-bot at linuxcontainers.org
Wed Apr 6 11:10:20 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160406/1304c338/attachment.bin>
-------------- next part --------------
From b2f44b4d9a754dd205fef8d5942fd62e02523268 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at mailbox.org>
Date: Wed, 6 Apr 2016 13:08:06 +0200
Subject: [PATCH] lxc_mount_auto_mounts(): free memory on failure

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>
---
 src/lxc/conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index ff2bcf3..3b023ef 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -719,6 +719,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha
 			}
 			if (!default_mounts[i].destination) {
 				ERROR("BUG: auto mounts destination %d was NULL", i);
+				free(source);
 				return -1;
 			}
 			/* will act like strdup if %r is not present */


More information about the lxc-devel mailing list