coverity: #1435200

Resource leak Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent c1768f3f
...@@ -562,10 +562,6 @@ int pin_rootfs(const char *rootfs) ...@@ -562,10 +562,6 @@ int pin_rootfs(const char *rootfs)
if (!realpath(rootfs, absrootfs)) if (!realpath(rootfs, absrootfs))
return -2; return -2;
ret = access(absrootfs, F_OK);
if (ret != 0)
return -1;
ret = stat(absrootfs, &s); ret = stat(absrootfs, &s);
if (ret < 0) if (ret < 0)
return -1; return -1;
...@@ -581,12 +577,12 @@ int pin_rootfs(const char *rootfs) ...@@ -581,12 +577,12 @@ int pin_rootfs(const char *rootfs)
if (fd < 0) if (fd < 0)
return fd; return fd;
if (fstatfs (fd, &sfs)) { ret = fstatfs (fd, &sfs);
return -1; if (ret < 0)
} return fd;
if (sfs.f_type == NFS_SUPER_MAGIC) { if (sfs.f_type == NFS_SUPER_MAGIC) {
DEBUG("rootfs on NFS, not unlinking pin file \"%s\".", absrootfspin); DEBUG("Rootfs on NFS, not unlinking pin file \"%s\"", absrootfspin);
return fd; return fd;
} }
......
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