From: Dwight Engen Date: Fri, 3 May 2013 20:50:32 +0000 (-0400) Subject: coverity: fix dereference NULL return value X-Git-Tag: lxc-1.0.0.alpha1~1^2~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab81cef05338e7a553aacca141287034d6daf167;p=thirdparty%2Flxc.git coverity: fix dereference NULL return value 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 Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 125e8a6d2..827626f1d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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);