]> 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>
Tue, 12 Dec 2017 10:55:56 +0000 (11:55 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
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);