]> git.sesse.net Git - vlc/commitdiff
* src/misc/variables.c: fixed memleak.
authorGildas Bazin <gbazin@videolan.org>
Sun, 29 Feb 2004 13:08:56 +0000 (13:08 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 29 Feb 2004 13:08:56 +0000 (13:08 +0000)
* include/vlc_common.h: use pragma to disable useless MSVC warnings.

include/vlc_common.h
src/misc/variables.c

index beead76809e0d39fdcaa3cf3a13f4fa856c74839..b49ed39ae083e8e65849cfc6823f91211b716bd1 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.109 2004/02/23 20:34:47 gbazin Exp $
+ * $Id: vlc_common.h,v 1.110 2004/02/29 13:08:56 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -43,6 +43,8 @@
 #   undef HAVE_STDINT_H
 #   undef HAVE_INTTYPES_H
 #   undef off_t
+#elif defined( _MSC_VER )
+#   pragma warning( disable : 4244 )
 #endif
 
 #include "vlc_config.h"
index 139a84b99a3be0faae02af2cb132115c813703df..1087bc23fbe605ca2b90ec8f496aa0d03f30cf56 100644 (file)
@@ -2,7 +2,7 @@
  * variables.c: routines for object variables handling
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: variables.c,v 1.37 2004/01/25 17:16:06 zorglub Exp $
+ * $Id: variables.c,v 1.38 2004/02/29 13:08:56 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -575,6 +575,18 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
             break;
         case VLC_VAR_FREELIST:
             FreeList( p_val );
+            if( p_val2 && p_val2->p_list )
+            {
+                for( i = 0; i < p_val2->p_list->i_count; i++ )
+                    if( p_val2->p_list->p_values[i].psz_string )
+                        free( p_val2->p_list->p_values[i].psz_string );
+                if( p_val2->p_list->i_count )
+                {
+                    free( p_val2->p_list->p_values );
+                    free( p_val2->p_list->pi_types );
+                }
+                free( p_val2->p_list );
+            }
             break;
         case VLC_VAR_SETTEXT:
             if( p_var->psz_text ) free( p_var->psz_text );