]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1426028
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 9 Dec 2017 19:04:46 +0000 (20:04 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Dec 2017 12:36:10 +0000 (13:36 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/storage/overlay.c

index d71bc75f7aee7834831f79d4862be83f8a2832fd..d2f3ed00c1aa33bf90f114280cd30c1cd5e8640e 100644 (file)
@@ -722,15 +722,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);