]> git.sesse.net Git - vlc/blobdiff - modules/misc/playlist/xspf.c
Fix memleaks.
[vlc] / modules / misc / playlist / xspf.c
index 64d45cb8b155b0b921a4368d78d622503c07ee49..e1178b2f94bc90cdf9332e4e63132a5b6a2a2548 100644 (file)
@@ -30,7 +30,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_interface.h>
 #include <vlc_playlist.h>
 #include <vlc_input.h>
 #include <vlc_charset.h>
 #include "xspf.h"
 
+#include <assert.h>
+
 /**
  * \brief Prints the XSPF header to file, writes each item by xspf_export_item()
  * and closes the open xml elements
  * \param p_this the VLC playlist object
  * \return VLC_SUCCESS if some memory is available, otherwise VLC_ENONMEM
  */
-int E_(xspf_export_playlist)( vlc_object_t *p_this )
+int xspf_export_playlist( vlc_object_t *p_this )
 {
     const playlist_t *p_playlist = (playlist_t *)p_this;
     const playlist_export_t *p_export =
@@ -75,8 +77,8 @@ int E_(xspf_export_playlist)( vlc_object_t *p_this )
     if( psz_temp && *psz_temp )
     {
         fprintf( p_export->p_file, "\t<location>%s</location>\n", psz_temp );
-        free( psz_temp );
     }
+    free( psz_temp );
 
     /* export all items in a flat format */
     fprintf( p_export->p_file, "\t<trackList>\n" );