]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: cleanup macros setup_proc_filesystem
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 19 Feb 2019 22:46:11 +0000 (23:46 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 19 Feb 2019 22:50:24 +0000 (23:50 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index d1537243b408be8c180b5929f05805c3c4fa96a2..76d85c0f027a5f599c9608dd4de32d4288d4c885 100644 (file)
@@ -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;