From cc6a0e78d75e35cdbb27ae966f0b2e1d5e18c29d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 19 Feb 2019 23:41:48 +0100 Subject: [PATCH] conf: auto free run_buffer Signed-off-by: Christian Brauner --- src/lxc/conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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"); -- 2.47.2