CID 374488: Error handling issues (CHECKED_RETURN)
Calling "blkid_get_cache" without checking return value (as is done elsewhere 4 out of 5 times).
It's probably unnecessary as we check the cache pointer later, but let's
make it more robust for static analyzers.
Signed-off-by: Karel Zak <kzak@redhat.com>
if (!c) {
char *cachefile = blkid_get_cache_filename(conf);
- blkid_get_cache(&c, cachefile);
+ int rc = blkid_get_cache(&c, cachefile);
free(cachefile);
+ if (rc < 0)
+ return NULL;
}
if (!c)
return NULL;