vlc | branch: master | Hannes Domani <[email protected]> | Fri Feb  6 13:59:29 
2015 +0100| [73a617b57af45a269964ce7990d199c664d48f62] | committer: 
Jean-Baptiste Kempf

zip: fix memory leaks

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 modules/access/zip/zipstream.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
index ac29c7a..a8c188b 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -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;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to