Remove filename ralloc comment. filename is allocated by asprintf.
Clean up disk_cache_get dead code left over from
367ac07efcc8
("disk_cache: move cache item loading code into
disk_cache_load_item() helper").
Fix defect reported by Coverity Scan.
Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement:
free(filename);
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6738>
char *filename = disk_cache_get_cache_filename(cache, key);
if (filename == NULL)
- goto fail;
+ return NULL;
return disk_cache_load_item(cache, filename, size);
-
-fail:
- if (filename)
- free(filename);
-
- return NULL;
}
void
fail:
if (data)
free(data);
+ if (filename)
+ free(filename);
if (uncompressed_data)
free(uncompressed_data);
if (file_header)
return NULL;
}
-/* Return a filename within the cache's directory corresponding to 'key'. The
- * returned filename is ralloced with 'cache' as the parent context.
+/* Return a filename within the cache's directory corresponding to 'key'.
*
* Returns NULL if out of memory.
*/