]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix possible NULL pointer dereference (#433)
authorIgor Pylypiv <igor.pylypiv@gmail.com>
Mon, 10 Jun 2019 20:52:35 +0000 (13:52 -0700)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 10 Jun 2019 20:52:35 +0000 (22:52 +0200)
cppcheck:
  [src/manifest.c:270] -> [src/manifest.c:269]: (warning)
  Either the condition '!errmsg' is redundant or there is possible null pointer
  dereference: errmsg.

src/manifest.c

index 00da5424e49849b9f232b8cdab58d934e392273d..6de842d2cb47573f0f18e914a0f378686c3d1db5 100644 (file)
@@ -266,7 +266,7 @@ read_manifest(gzFile f, char **errmsg)
        return mf;
 
 error:
-       if (!errmsg) {
+       if (!*errmsg) {
                *errmsg = x_strdup("Corrupt manifest file");
        }
        free_manifest(mf);