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

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:08:14 2012 +0200| [0813e08f0be94a42114440ebe07d41bec5555c93] | committer: Rémi Duraffort

rc: fix some memory leaks.

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

 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 1885730..38f675b 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 );
@@ -1733,6 +1732,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;
@@ -1741,6 +1741,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;
         }
 
@@ -1757,7 +1758,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
@@ -1767,6 +1767,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