[vlc-devel] commit: mosaic: Free string variables after using them ( Rafaël Carré )

git version control git at videolan.org
Tue May 6 13:11:00 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue May  6 11:25:58 2008 +0200| [f4bdd3effb57aa42c20dafcaf001f97b7b8718c9]

mosaic: Free string variables after using them

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

 modules/video_filter/mosaic.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/video_filter/mosaic.c b/modules/video_filter/mosaic.c
index 0961d37..647ccf3 100644
--- a/modules/video_filter/mosaic.c
+++ b/modules/video_filter/mosaic.c
@@ -283,7 +283,7 @@ static int CreateFilter( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys;
     vlc_object_t *p_libvlc = VLC_OBJECT( p_filter->p_libvlc );
-    char *psz_order;
+    char *psz_order, *_psz_order;
     char *psz_offsets;
     int i_index;
     vlc_value_t val;
@@ -349,6 +349,7 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->i_order_length = 0;
     p_sys->ppsz_order = NULL;
     psz_order = var_CreateGetStringCommand( p_filter, CFG_PREFIX "order" );
+    _psz_order = psz_order;
     var_AddCallback( p_filter, CFG_PREFIX "order", MosaicCallback, p_sys );
 
     if( *psz_order )
@@ -368,12 +369,15 @@ static int CreateFilter( vlc_object_t *p_this )
         p_sys->i_order_length = i_index;
     }
 
+    free( _psz_order );
+
     /* Manage specific offsets for substreams */
     psz_offsets = var_CreateGetStringCommand( p_filter, CFG_PREFIX "offsets" );
     p_sys->i_offsets_length = 0;
     p_sys->pi_x_offsets = NULL;
     p_sys->pi_y_offsets = NULL;
     mosaic_ParseSetOffsets( p_filter, p_sys, psz_offsets );
+    free( psz_offsets );
     var_AddCallback( p_filter, CFG_PREFIX "offsets", MosaicCallback, p_sys );
 
     vlc_mutex_unlock( &p_sys->lock );




More information about the vlc-devel mailing list