From 0c669152e51e76e22cb499a38aecf816a0b1f3bc Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 19 Feb 2019 23:46:11 +0100 Subject: [PATCH] conf: cleanup macros setup_proc_filesystem Signed-off-by: Christian Brauner --- src/lxc/conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index d1537243b..76d85c0f0 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2666,10 +2666,10 @@ int setup_sysctl_parameters(struct lxc_list *sysctls) int setup_proc_filesystem(struct lxc_list *procs, pid_t pid) { + __do_free char *tmp = NULL; struct lxc_list *it; struct lxc_proc *elem; int ret = 0; - char *tmp = NULL; char filename[PATH_MAX] = {0}; lxc_list_for_each (it, procs) { @@ -2681,7 +2681,6 @@ int setup_proc_filesystem(struct lxc_list *procs, pid_t pid) } ret = snprintf(filename, sizeof(filename), "/proc/%d/%s", pid, tmp); - free(tmp); if (ret < 0 || (size_t)ret >= sizeof(filename)) { ERROR("Error setting up proc filesystem path"); return -1; -- 2.47.2