[vlc-devel] commit: Fix a memory leak when media library is disabled ( Rafaël Carré )
git version control
git at videolan.org
Wed Apr 1 15:15:03 CEST 2009
vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Mar 30 19:35:39 2009 +0200| [9f26d456fb60d1047a007947ee95ba322574faca] | committer: Rafaël Carré
Fix a memory leak when media library is disabled
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9f26d456fb60d1047a007947ee95ba322574faca
---
src/playlist/loadsave.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 5be9767..e7bbec2 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -114,11 +114,15 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
int playlist_MLLoad( playlist_t *p_playlist )
{
- char *psz_datadir = config_GetUserDataDir();
+ char *psz_datadir;
char *psz_uri = NULL;
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 */
{
msg_Err( p_playlist, "no data directory, cannot load media library") ;
@@ -195,8 +199,13 @@ error:
int playlist_MLDump( playlist_t *p_playlist )
{
- char *psz_datadir = config_GetUserDataDir();
- if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS;
+ char *psz_datadir;
+
+ if( !config_GetInt( p_playlist, "media-library") )
+ return VLC_SUCCESS;
+
+ psz_datadir = config_GetUserDataDir();
+
if( !psz_datadir ) /* XXX: This should never happen */
{
msg_Err( p_playlist, "no data directory, cannot save media library") ;
More information about the vlc-devel
mailing list