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

Rémi Duraffort git at videolan.org
Sun Oct 20 09:29:50 CEST 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Oct 20 09:29:19 2013 +0200| [ed69a40c887aa7550a6e8f1505c9b6388a7d2e5e] | committer: Rémi Duraffort

zip: fix memory leak (cid #1062581)

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

 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 b27fe00..85e93d4 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -597,7 +597,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