]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: cleanup macros setup_mount_entries
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 22 Feb 2019 21:07:26 +0000 (22:07 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 22 Feb 2019 21:07:26 +0000 (22:07 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 088fc003ce3df65a52495d35cb10d9ef63f63669..1e5bcb2f71ffb56e83236c1ec3a13089f0d951da 100644 (file)
@@ -2413,17 +2413,13 @@ static int setup_mount_entries(const struct lxc_conf *conf,
                               struct lxc_list *mount, const char *lxc_name,
                               const char *lxc_path)
 {
-       int ret;
-       FILE *f;
+       __do_fclose FILE *f = NULL;
 
        f = make_anonymous_mount_file(mount, conf->lsm_aa_allow_nesting);
        if (!f)
                return -1;
 
-       ret = mount_file_entries(conf, rootfs, f, lxc_name, lxc_path);
-       fclose(f);
-
-       return ret;
+       return mount_file_entries(conf, rootfs, f, lxc_name, lxc_path);
 }
 
 static int parse_cap(const char *cap)