From 9b3a219b6c2c83a752cbab142483ae0551e3818a Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Fri, 7 Aug 2009 00:26:53 +0200 Subject: [PATCH] Fixed a segfault in module_Load in case of error. --- src/modules/os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/os.c b/src/modules/os.c index 28862a2cf8..63df567bf1 100644 --- a/src/modules/os.c +++ b/src/modules/os.c @@ -188,12 +188,13 @@ int module_Load( vlc_object_t *p_this, const char *psz_file, char *path = ToLocale( psz_file ); handle = dlopen( path, flags ); - LocaleFree( path ); if( handle == NULL ) { msg_Warn( p_this, "cannot load module `%s' (%s)", path, dlerror() ); + LocaleFree( path ); return -1; } + LocaleFree( path ); #elif defined(HAVE_DL_SHL_LOAD) handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL ); -- 2.39.2