From 5b2d189ab5e5d618a99598e23ef91acceddbd239 Mon Sep 17 00:00:00 2001 From: David Hill Date: Sun, 15 Jun 2014 15:40:08 -0400 Subject: Silence a compiler warning. If the first g_module_symbol call failed, module_deinit was set to value2, which is uninitialized. Move the assignment after checking variable found to silence the warning. --- src/core/modules-load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/modules-load.c b/src/core/modules-load.c index 9b9bc952..8e65ecd4 100644 --- a/src/core/modules-load.c +++ b/src/core/modules-load.c @@ -184,9 +184,6 @@ static int module_load_name(const char *path, const char *rootmodule, g_free(initfunc); g_free(deinitfunc); - module_init = value1; - module_deinit = value2; - if (!found) { module_error(MODULE_ERROR_INVALID, NULL, rootmodule, submodule); @@ -194,6 +191,9 @@ static int module_load_name(const char *path, const char *rootmodule, return 0; } + module_init = value1; + module_deinit = value2; + /* Call the module's init() function - it should register itself with module_register() function, abort if it doesn't. */ module_init(); -- cgit v1.2.3