Commit 00b8684e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Fix module entry error handling

parent 8dcd943c
...@@ -102,7 +102,7 @@ E_(vlc_entry) ( module_t *p_module ); ...@@ -102,7 +102,7 @@ E_(vlc_entry) ( module_t *p_module );
EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \ EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \
__VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \ __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \
{ \ { \
int i_shortcut = 1; \ int i_shortcut = 1, res; \
size_t i_config = (size_t)(-1); \ size_t i_config = (size_t)(-1); \
module_config_t *p_config = NULL; \ module_config_t *p_config = NULL; \
STORE_SYMBOLS; \ STORE_SYMBOLS; \
...@@ -126,8 +126,7 @@ E_(vlc_entry) ( module_t *p_module ); ...@@ -126,8 +126,7 @@ E_(vlc_entry) ( module_t *p_module );
#define vlc_module_end( ) \ #define vlc_module_end( ) \
p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \ p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \
} \ } \
if (config_Duplicate( p_module, p_config, ++i_config )) \ res = config_Duplicate( p_module, p_config, ++i_config ); \
return VLC_ENOMEM; \
for( size_t i = 0; i < i_config; i++ ) \ for( size_t i = 0; i < i_config; i++ ) \
{ \ { \
if( p_config[ i ].i_action ) \ if( p_config[ i ].i_action ) \
...@@ -137,8 +136,8 @@ E_(vlc_entry) ( module_t *p_module ); ...@@ -137,8 +136,8 @@ E_(vlc_entry) ( module_t *p_module );
} \ } \
} \ } \
free( p_config ); \ free( p_config ); \
if( p_module->p_config == NULL ) \ if (res) \
return VLC_EGENERIC; \ return res; \
(void)i_shortcut; \ (void)i_shortcut; \
return VLC_SUCCESS; \ return VLC_SUCCESS; \
} \ } \
......
...@@ -618,6 +618,7 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig, ...@@ -618,6 +618,7 @@ int config_Duplicate( module_t *p_module, const module_config_t *p_orig,
p_module->p_config[i].pf_callback = p_orig[i].pf_callback; p_module->p_config[i].pf_callback = p_orig[i].pf_callback;
} }
return VLC_SUCCESS;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment