[vlc-devel] commit: Fix memleak when parsing VLC_VAR_LIST. ( Rémi Duraffort )

git version control git at videolan.org
Fri Sep 26 20:28:08 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Sep 26 20:30:28 2008 +0200| [b34411aee974685b30b8a9779576aa496012413a] | committer: Rémi Duraffort 

Fix memleak when parsing VLC_VAR_LIST.
Backported from 0.9-bugfix

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

 src/misc/variables.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index ad297c6..c524568 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -1163,6 +1163,10 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
 
     var_Set( p_obj, psz_name, val );
 
+    // If that's a list, remove all elements allocated
+    if( i_type == VLC_VAR_LIST )
+        FreeList( &val );
+
 cleanup:
     free( psz_name );
 }




More information about the vlc-devel mailing list