From: Christian Brauner Date: Tue, 19 Feb 2019 22:41:48 +0000 (+0100) Subject: conf: auto free run_buffer X-Git-Tag: lxc-3.2.0~132^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc6a0e78d75e35cdbb27ae966f0b2e1d5e18c29d;p=thirdparty%2Flxc.git conf: auto free run_buffer Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index cb5730af6..bdd3a9f4f 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -306,8 +306,8 @@ static struct limit_opt limit_opt[] = { static int run_buffer(char *buffer) { + __do_free char *output = NULL; int ret; - char *output; struct lxc_popen_FILE *f; f = lxc_popen(buffer); @@ -326,8 +326,6 @@ static int run_buffer(char *buffer) while (fgets(output, LXC_LOG_BUFFER_SIZE, f->f)) DEBUG("Script %s with output: %s", buffer, output); - free(output); - ret = lxc_pclose(f); if (ret == -1) { SYSERROR("Script exited with error");