Commit ab81cef0 by Dwight Engen Committed by Serge Hallyn

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: 's avatarDwight Engen <dwight.engen@oracle.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 7c7ec7a8
...@@ -1067,10 +1067,11 @@ int detect_shared_rootfs(void) ...@@ -1067,10 +1067,11 @@ int detect_shared_rootfs(void)
if (strcmp(p+1, "/") == 0) { if (strcmp(p+1, "/") == 0) {
// this is '/'. is it shared? // this is '/'. is it shared?
p = index(p2+1, ' '); p = index(p2+1, ' ');
if (strstr(p, "shared:")) { if (p && strstr(p, "shared:")) {
fclose(f); fclose(f);
return 1; return 1;
} }
break;
} }
} }
fclose(f); fclose(f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment