Fix various potential illegal access and memory leaks in error conditions.
This commit is contained in:
@ -41,11 +41,9 @@
|
||||
static int
|
||||
art_cache_exists(const char *orig_path, char **cache_file)
|
||||
{
|
||||
if( asprintf(cache_file, "%s/art_cache%s", db_path, orig_path) < 0 )
|
||||
{
|
||||
*cache_file = NULL;
|
||||
if( xasprintf(cache_file, "%s/art_cache%s", db_path, orig_path) < 0 )
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(strchr(*cache_file, '\0')-4, ".jpg");
|
||||
|
||||
return (!access(*cache_file, F_OK));
|
||||
|
Reference in New Issue
Block a user