Commit f6569123 authored by Rémi Duraffort's avatar Rémi Duraffort

ML: fix potential memleaks.

parent e0f5d173
...@@ -471,7 +471,10 @@ int SQLToMediaArray( media_library_t *p_ml, vlc_array_t *p_result_array, ...@@ -471,7 +471,10 @@ int SQLToMediaArray( media_library_t *p_ml, vlc_array_t *p_result_array,
/* Analyze first row */ /* Analyze first row */
int *indexes = ( int* ) calloc( i_cols + 1, sizeof( int ) ); int *indexes = ( int* ) calloc( i_cols + 1, sizeof( int ) );
if( !indexes ) if( !indexes )
{
vlc_array_destroy( p_intermediate_array );
return VLC_ENOMEM; return VLC_ENOMEM;
}
const int count = sizeof( ml_table_map )/ sizeof( struct ml_table_elt ); const int count = sizeof( ml_table_map )/ sizeof( struct ml_table_elt );
for( int col = 0; col < i_cols; col++ ) for( int col = 0; col < i_cols; col++ )
...@@ -508,14 +511,16 @@ int SQLToMediaArray( media_library_t *p_ml, vlc_array_t *p_result_array, ...@@ -508,14 +511,16 @@ int SQLToMediaArray( media_library_t *p_ml, vlc_array_t *p_result_array,
if( !p_media ) if( !p_media )
{ {
free( indexes ); free( indexes );
return VLC_ENOMEM; i_ret = VLC_ENOMEM;
goto quit_sqlmediaarray;
} }
p_result = ( ml_result_t * ) calloc( 1, sizeof( ml_result_t ) ); p_result = ( ml_result_t * ) calloc( 1, sizeof( ml_result_t ) );
if( !p_result ) if( !p_result )
{ {
ml_gc_decref( p_media ); ml_gc_decref( p_media );
free( indexes ); free( indexes );
return VLC_ENOMEM; i_ret = VLC_ENOMEM;
goto quit_sqlmediaarray;
} }
char* psz_append_pname = NULL; char* psz_append_pname = NULL;
......
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