]> git.sesse.net Git - vlc/commitdiff
zip: fix memory leaks
authorHannes Domani <ssbssa@yahoo.de>
Fri, 6 Feb 2015 12:59:29 +0000 (13:59 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 7 Feb 2015 15:28:04 +0000 (16:28 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/access/zip/zipstream.c

index ac29c7a7a0512e7dafca7e61c431a6e32cdf4748..a8c188b199942801adcd5632e675471666734bf6 100644 (file)
@@ -121,6 +121,13 @@ inline static void free_all_node( node *root )
     {
         free_all_node( root->child );
         free( root->name );
+        item *media = root->media;
+        while( media )
+        {
+            item *next_media = media->next;
+            free( media );
+            media = next_media;
+        }
         node *tmp = root->next;
         free( root );
         root = tmp;
@@ -563,6 +570,7 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
 
     /* Root node */
     node *playlist = new_node( psz_zip );
+    free( psz_zip );
 
     /* Encode the URI and append ZIP_SEP */
     char *psz_pathtozip;