Commit 763f3641 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix memory leak

parent 45915c74
...@@ -353,18 +353,19 @@ static int __input_FindArtInCache( vlc_object_t *p_obj, input_item_t *p_item ) ...@@ -353,18 +353,19 @@ static int __input_FindArtInCache( vlc_object_t *p_obj, input_item_t *p_item )
while( (p_de = utf8_readdir( p_dir )) ) while( (p_de = utf8_readdir( p_dir )) )
{ {
if( strncmp( p_de, "art", 3 ) ) if( !strncmp( p_de, "art", 3 ) )
{ {
snprintf( psz_filename, MAX_PATH, "%s" DIR_SEP "%s", snprintf( psz_filename, MAX_PATH, "%s" DIR_SEP "%s",
psz_dirname, p_de ); psz_dirname, p_de );
input_item_SetArtURL( p_item, psz_filename ); input_item_SetArtURL( p_item, psz_filename );
closedir( p_dir ); free( p_de );
return VLC_SUCCESS; break;
} }
free( p_de );
} }
closedir( p_dir ); closedir( p_dir );
return VLC_EGENERIC; return (p_de == NULL) ? VLC_EGENERIC : VLC_SUCCESS;
} }
/** /**
......
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