[vlc-devel] commit: svg module: fix memleak. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 1 15:46:43 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug  1 15:48:51 2008 +0200| [b751665aa8f78719eb3e4fe30545fffd5c423948] | committer: Rémi Duraffort 

svg module: fix memleak.

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

 modules/misc/svg.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/misc/svg.c b/modules/misc/svg.c
index e059ea3..d601cd7 100644
--- a/modules/misc/svg.c
+++ b/modules/misc/svg.c
@@ -202,6 +202,7 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
                 if( !psz_template )
                 {
                     fclose( file );
+                    free( psz_filename );
                     return NULL;
                 }
                 memset( psz_template, 0, s.st_size + 1 );
@@ -210,6 +211,7 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
             fclose( file );
         }
     }
+    free( psz_filename );
     if( !psz_template )
     {
         /* Either there was no file, or there was an error.




More information about the vlc-devel mailing list