[vlc-commits] addons: Fix memory leak

Hugo Beauzée-Luyssen git at videolan.org
Tue May 16 18:45:13 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue May 16 18:44:11 2017 +0200| [a7c83d6d399546d6059369f623778a98b8096423] | committer: Hugo Beauzée-Luyssen

addons: Fix memory leak

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

 modules/misc/addons/vorepository.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/misc/addons/vorepository.c b/modules/misc/addons/vorepository.c
index 4d7061a4ab..8a34b0ffcd 100644
--- a/modules/misc/addons/vorepository.c
+++ b/modules/misc/addons/vorepository.c
@@ -148,7 +148,11 @@ static int ParseManifest( addons_finder_t *p_finder, addon_entry_t *p_entry,
         case XML_READER_TEXT:
             if ( data_pointer.e_type == TYPE_NONE || !p_entry ) break;
             if ( data_pointer.e_type == TYPE_STRING )
+            {
+                if( data_pointer.u_data.ppsz )
+                    free( data_pointer.u_data.ppsz );
                 *data_pointer.u_data.ppsz = strdup( p_node );
+            }
             else
             if ( data_pointer.e_type == TYPE_LONG )
                 *data_pointer.u_data.pl = atol( p_node );
@@ -285,7 +289,11 @@ static int ParseCategoriesInfo( addons_finder_t *p_finder, stream_t *p_stream )
         case XML_READER_TEXT:
             if ( data_pointer.e_type == TYPE_NONE || !p_entry ) break;
             if ( data_pointer.e_type == TYPE_STRING )
+            {
+                if( data_pointer.u_data.ppsz )
+                    free( *data_pointer.u_data.ppsz );
                 *data_pointer.u_data.ppsz = strdup( p_node );
+            }
             else
             if ( data_pointer.e_type == TYPE_LONG )
                 *data_pointer.u_data.pl = atol( p_node );



More information about the vlc-commits mailing list