]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: fix dereference NULL return value
authorDwight Engen <dwight.engen@oracle.com>
Fri, 3 May 2013 20:50:32 +0000 (16:50 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 7 May 2013 00:10:09 +0000 (19:10 -0500)
also break once we have found root, no need to search the rest of the mounts

Changelog: May 6: Serge: don't add the break.  (see m-l)

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 125e8a6d2107fb88351b1fa9dff5812beeceedda..827626f1d7f86608f907330de548b344a057bd21 100644 (file)
@@ -1067,10 +1067,11 @@ int detect_shared_rootfs(void)
                if (strcmp(p+1, "/") == 0) {
                        // this is '/'.  is it shared?
                        p = index(p2+1, ' ');
-                       if (strstr(p, "shared:")) {
+                       if (p && strstr(p, "shared:")) {
                                fclose(f);
                                return 1;
                        }
+                       break;
                }
        }
        fclose(f);