]> git.sesse.net Git - vlc/commitdiff
Fix leaking of psz_object_name
authorRafaël Carré <funman@videolan.org>
Mon, 5 May 2008 09:10:48 +0000 (11:10 +0200)
committerRafaël Carré <funman@videolan.org>
Mon, 5 May 2008 09:10:48 +0000 (11:10 +0200)
src/modules/cache.c
src/modules/modules.c

index 4e96d48188c938bc6b02357235cdc2fe8ae7237e..61c60747ffdc856d99fec0559edb1c7d01d1e63b 100644 (file)
@@ -265,6 +265,7 @@ void CacheLoad( vlc_object_t *p_this )
         pp_cache[i]->p_module = vlc_module_create( p_this );
 
         /* Load additional infos */
+        free( pp_cache[i]->p_module->psz_object_name );
         LOAD_STRING( pp_cache[i]->p_module->psz_object_name );
         LOAD_STRING( pp_cache[i]->p_module->psz_shortname );
         LOAD_STRING( pp_cache[i]->p_module->psz_longname );
index dfd51d44949ac34c3cd72e7b6f51f3b24e24758b..af619a582a476c063579aecfe7e1f998dcda0175 100644 (file)
@@ -1312,7 +1312,6 @@ static void DupModule( module_t *p_module )
 
     /* We strdup() these entries so that they are still valid when the
      * module is unloaded. */
-    p_module->psz_object_name = strdup( p_module->psz_object_name );
     p_module->psz_capability = strdup( p_module->psz_capability );
     p_module->psz_shortname = p_module->psz_shortname ?
                                  strdup( p_module->psz_shortname ) : NULL;