[vlc-commits] zip: fix memory leak (cid #1062581)

Rémi Duraffort git at videolan.org
Sun Oct 20 16:19:10 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Oct 20 09:29:19 2013 +0200| [64d800879f0d455e616a3e839eec7192049e7370] | committer: Jean-Baptiste Kempf

zip: fix memory leak (cid #1062581)

(cherry picked from commit ed69a40c887aa7550a6e8f1505c9b6388a7d2e5e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/zip/zipstream.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
index 2791925..f505738 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -598,7 +598,12 @@ static int WriteXSPF( char **pp_buffer, vlc_array_t *p_filenames,
             char *psz_path = strdup( psz_pathtozip );
             char *psz_escapedName;
             escapeToXml( &psz_escapedName, psz_name );
-            if( astrcatf( &psz_path, "%s", psz_escapedName ) < 0 ) return -1;
+            if( astrcatf( &psz_path, "%s", psz_escapedName ) < 0 )
+            {
+                free( psz_escapedName );
+                return -1;
+            }
+            free( psz_escapedName );
 
             /* Track information */
             if( astrcatf( pp_buffer,



More information about the vlc-commits mailing list