Commit 9f26d456 authored by Rafaël Carré's avatar Rafaël Carré

Fix a memory leak when media library is disabled

parent d550023d
...@@ -114,11 +114,15 @@ static void input_item_subitem_added( const vlc_event_t * p_event, ...@@ -114,11 +114,15 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
int playlist_MLLoad( playlist_t *p_playlist ) int playlist_MLLoad( playlist_t *p_playlist )
{ {
char *psz_datadir = config_GetUserDataDir(); char *psz_datadir;
char *psz_uri = NULL; char *psz_uri = NULL;
input_item_t *p_input; input_item_t *p_input;
if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS; if( !config_GetInt( p_playlist, "media-library") )
return VLC_SUCCESS;
psz_datadir = config_GetUserDataDir();
if( !psz_datadir ) /* XXX: This should never happen */ if( !psz_datadir ) /* XXX: This should never happen */
{ {
msg_Err( p_playlist, "no data directory, cannot load media library") ; msg_Err( p_playlist, "no data directory, cannot load media library") ;
...@@ -195,8 +199,13 @@ error: ...@@ -195,8 +199,13 @@ error:
int playlist_MLDump( playlist_t *p_playlist ) int playlist_MLDump( playlist_t *p_playlist )
{ {
char *psz_datadir = config_GetUserDataDir(); char *psz_datadir;
if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS;
if( !config_GetInt( p_playlist, "media-library") )
return VLC_SUCCESS;
psz_datadir = config_GetUserDataDir();
if( !psz_datadir ) /* XXX: This should never happen */ if( !psz_datadir ) /* XXX: This should never happen */
{ {
msg_Err( p_playlist, "no data directory, cannot save media library") ; msg_Err( p_playlist, "no data directory, cannot save media library") ;
......
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