From: Christian Brauner Date: Tue, 19 Feb 2019 22:45:03 +0000 (+0100) Subject: conf: cleanup macros mount_entry_create_dir_file X-Git-Tag: lxc-3.2.0~132^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a76eeaa078850c326ca32aefe94f24dbba7989f;p=thirdparty%2Flxc.git conf: cleanup macros mount_entry_create_dir_file Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index e9bbbb1ce..0ef7d4b1b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2135,8 +2135,9 @@ static int mount_entry_create_dir_file(const struct mntent *mntent, const struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { + __do_free char *p1 = NULL; int ret; - char *p1, *p2; + char *p2; if (strncmp(mntent->mnt_type, "overlay", 7) == 0) { ret = ovl_mkdir(mntent, rootfs, lxc_name, lxc_path); @@ -2166,7 +2167,6 @@ static int mount_entry_create_dir_file(const struct mntent *mntent, p2 = dirname(p1); ret = mkdir_p(p2, 0755); - free(p1); if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create directory \"%s\"", path); return -1;