]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/storage/overlay.c
coverity: #1426028
[mirror_lxc.git] / src / lxc / storage / overlay.c
index 6b93eb03b14707c89c03626bcabc6af8a3856d85..f32e6eecb1a8e32286aa911f18bf54f9b2656c4a 100644 (file)
@@ -725,15 +725,9 @@ char *ovl_get_rootfs(const char *rootfs_path, size_t *rootfslen)
                *s3 = '\0';
 
        rootfsdir = strdup(s2);
-       if (!rootfsdir) {
-               free(s1);
-               return NULL;
-       }
-
+       free(s1);
        if (!rootfsdir)
-               rootfsdir = s1;
-       else
-               free(s1);
+               return NULL;
 
        *rootfslen = strlen(rootfsdir);