conf: cleanup macros pin_rootfs

parent e1a94937
...@@ -536,9 +536,9 @@ int run_script(const char *name, const char *section, const char *script, ...) ...@@ -536,9 +536,9 @@ int run_script(const char *name, const char *section, const char *script, ...)
*/ */
int pin_rootfs(const char *rootfs) int pin_rootfs(const char *rootfs)
{ {
__do_free char *absrootfs = NULL;
int fd, ret; int fd, ret;
char absrootfspin[PATH_MAX]; char absrootfspin[PATH_MAX];
char *absrootfs;
struct stat s; struct stat s;
struct statfs sfs; struct statfs sfs;
...@@ -550,18 +550,13 @@ int pin_rootfs(const char *rootfs) ...@@ -550,18 +550,13 @@ int pin_rootfs(const char *rootfs)
return -2; return -2;
ret = stat(absrootfs, &s); ret = stat(absrootfs, &s);
if (ret < 0) { if (ret < 0)
free(absrootfs);
return -1; return -1;
}
if (!S_ISDIR(s.st_mode)) { if (!S_ISDIR(s.st_mode))
free(absrootfs);
return -2; return -2;
}
ret = snprintf(absrootfspin, PATH_MAX, "%s/.lxc-keep", absrootfs); ret = snprintf(absrootfspin, PATH_MAX, "%s/.lxc-keep", absrootfs);
free(absrootfs);
if (ret < 0 || ret >= PATH_MAX) if (ret < 0 || ret >= PATH_MAX)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment