[vlc-commits] audiobargraph: fix memory leak.

Rémi Duraffort git at videolan.org
Wed Aug 29 20:17:23 CEST 2012


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 29 20:10:25 2012 +0200| [6633ef04bdbcd73524b920a01f4dbe758f289e08] | committer: Rémi Duraffort

audiobargraph: fix memory leak.

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

 modules/video_filter/audiobargraph_v.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_filter/audiobargraph_v.c b/modules/video_filter/audiobargraph_v.c
index d163503..c938b36 100644
--- a/modules/video_filter/audiobargraph_v.c
+++ b/modules/video_filter/audiobargraph_v.c
@@ -461,7 +461,6 @@ static int BarGraphCallback( vlc_object_t *p_this, char const *psz_var,
     VLC_UNUSED(oldval);
     filter_sys_t *p_sys = (filter_sys_t *)p_data;
     BarGraph_t *p_BarGraph = &(p_sys->p_BarGraph);
-    char* i_values;
     char* res = NULL;
 
     vlc_mutex_lock( &p_sys->lock );
@@ -488,15 +487,16 @@ static int BarGraphCallback( vlc_object_t *p_this, char const *psz_var,
             picture_Release( p_BarGraph->p_pic );
             p_BarGraph->p_pic = NULL;
         }
-        i_values = strdup( newval.psz_string );
+        char *psz_i_values = strdup( newval.psz_string );
         free(p_BarGraph->i_values);
         //p_BarGraph->i_values = NULL;
         //p_BarGraph->nbChannels = 0;
         // in case many answer are received at the same time, only keep one
-        res = strchr(i_values, '@');
+        res = strchr(psz_i_values, '@');
         if (res)
             *res = 0;
-        parse_i_values( p_BarGraph, i_values);
+        parse_i_values( p_BarGraph, psz_i_values);
+        free( psz_i_values );
         LoadBarGraph(p_this,p_BarGraph);
     }
     else if ( !strcmp( psz_var, "audiobargraph_v-alarm" ) )



More information about the vlc-commits mailing list