[vlc-commits] commit: src/playlist/loadsave.c : Fix [1644d683e9df] ( Rafaël Carré )

git at videolan.org git at videolan.org
Fri Jul 9 19:14:50 CEST 2010


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Fri Jul  9 19:12:58 2010 +0200| [fe3cb633a222d1dde3fc300fe654b66a1c9b070c] | committer: Rafaël Carré 

src/playlist/loadsave.c : Fix [1644d683e9df]

typo and double free

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe3cb633a222d1dde3fc300fe654b66a1c9b070c
---

 src/playlist/loadsave.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index ce9f9d1..eed2f8e 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -128,7 +128,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
     }
 
     char *psz_file;
-    if( asprintf( &psz_file, "%s" DIR_SEP "ml.xspf", psz_datadir ) != -1 )
+    if( asprintf( &psz_file, "%s" DIR_SEP "ml.xspf", psz_datadir ) == -1 )
         psz_file = NULL;
     free( psz_datadir );
     if( psz_file == NULL )
@@ -136,10 +136,11 @@ int playlist_MLLoad( playlist_t *p_playlist )
 
     /* loosy check for media library file */
     struct stat st;
-    int ret = vlc_stat( psz_file, &st );
-    free( psz_file );
-    if( ret )
+    if( vlc_stat( psz_file, &st ) )
+    {
+        free( psz_file );
         return VLC_EGENERIC;
+    }
 
     char *psz_uri = make_URI( psz_file, "file/xspf-open" );
     free( psz_file );



More information about the vlc-commits mailing list