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

index f7ad1ba2fef43ddc3996fe91099433b08fe07614..79ae7f157d64ffaa7e0e9ba1e72550ea8a8f6d87 100644 (file)
@@ -3283,11 +3283,11 @@ void tmp_proc_unmount(struct lxc_conf *lxc_conf)
 /* Walk /proc/mounts and change any shared entries to slave. */
 void remount_all_slave(void)
 {
+       __do_free char *line = NULL;
        int memfd, mntinfo_fd, ret;
        ssize_t copied;
        FILE *f;
        size_t len = 0;
-       char *line = NULL;
 
        mntinfo_fd = open("/proc/self/mountinfo", O_RDONLY | O_CLOEXEC);
        if (mntinfo_fd < 0) {
@@ -3369,7 +3369,6 @@ again:
                TRACE("Remounted \"%s\" as MS_SLAVE", target);
        }
        fclose(f);
-       free(line);
        TRACE("Remounted all mount table entries as MS_SLAVE");
 }