[vlc-devel] commit: modules: Make sure DupModule() work as expected. ( Pointed by courmisch). (Pierre d'Herbemont )
git version control
git at videolan.org
Wed Apr 16 17:27:50 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Wed Apr 16 17:19:46 2008 +0200| [b7fb80f532124d8cfd31132cd4503b157f7893fc]
modules: Make sure DupModule() work as expected. (Pointed by courmisch).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b7fb80f532124d8cfd31132cd4503b157f7893fc
---
src/modules/modules.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 332eaff..0b6b26c 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -1312,7 +1312,7 @@ static void DupModule( module_t *p_module )
/* We strdup() these entries so that they are still valid when the
* module is unloaded. */
/* This one is a (const char *) that will never get freed. */
- p_module->psz_object_name = p_module->psz_object_name;
+ 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;
@@ -1346,6 +1346,7 @@ static void UndupModule( module_t *p_module )
free( *pp_shortcut );
}
+ free( p_module->psz_object_name );
free( p_module->psz_capability );
free( p_module->psz_shortname );
free( p_module->psz_longname );
More information about the vlc-devel
mailing list