[lxc-devel] [lxc/master] Set c to NULL after freeing it

caglar10ur on Github lxc-bot at linuxcontainers.org
Wed Dec 26 19:20:22 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 349 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181226/6b4eb9d4/attachment.bin>
-------------- next part --------------
From 370c786023e605bf7e2250a478b7dd2bee28ec42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= <caglar at 10ur.org>
Date: Wed, 26 Dec 2018 11:18:31 -0800
Subject: [PATCH] Set c to NULL after freeing it
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
---
 src/lxc/lxccontainer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index 1e5e6ad05a..b04bd86e3c 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -299,6 +299,7 @@ static void lxc_container_free(struct lxc_container *c)
 	c->config_path = NULL;
 
 	free(c);
+	c = NULL;
 }
 
 /* Consider the following case:


More information about the lxc-devel mailing list