[vlc-commits] rc: fix some memory leaks.

Rémi Duraffort git at videolan.org
Thu Aug 30 22:03:01 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 29 20:08:14 2012 +0200| [b82579c0adc029b784b4f50887dc7595799e5d32] | committer: Jean-Baptiste Kempf

rc: fix some memory leaks.
(cherry picked from commit 0813e08f0be94a42114440ebe07d41bec5555c93)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/control/rc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 04dc01e..5610032 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1197,9 +1197,8 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
             }
             var_FreeList( &val, &text );
             msg_rc( "+----[ end of %s ]", val_name.psz_string );
-
-            free( val_name.psz_string );
         }
+        free( val_name.psz_string );
     }
 out:
     vlc_object_release( p_input );
@@ -1724,6 +1723,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
         if ( var_Get( p_aout, psz_variable, &val ) < 0 )
         {
             vlc_object_release( p_aout );
+            free( val_name.psz_string );
             return VLC_EGENERIC;
         }
         i_value = val.i_int;
@@ -1732,6 +1732,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
                          VLC_VAR_GETLIST, &val, &text ) < 0 )
         {
             vlc_object_release( p_aout );
+            free( val_name.psz_string );
             return VLC_EGENERIC;
         }
 
@@ -1748,7 +1749,6 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
         var_FreeList( &val, &text );
         msg_rc( "+----[ end of %s ]", val_name.psz_string );
 
-        free( val_name.psz_string );
         i_error = VLC_SUCCESS;
     }
     else
@@ -1758,6 +1758,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
 
         i_error = var_Set( p_aout, psz_variable, val );
     }
+    free( val_name.psz_string );
     vlc_object_release( p_aout );
 
     return i_error;



More information about the vlc-commits mailing list