Handle valid symbols that are NULL correctly. (#385388, Felix Kater)

2006-12-13  Matthias Clasen  <mclasen@redhat.com>

        * gmodule.c (g_module_open):
        * gmodule-dl.c (_g_module_symbol): Handle valid symbols
        that are NULL correctly.  (#385388, Felix Kater)
This commit is contained in:
Matthias Clasen
2006-12-13 15:41:22 +00:00
committed by Matthias Clasen
parent caecf2dda0
commit ea1512221b
5 changed files with 40 additions and 5 deletions

View File

@@ -477,7 +477,7 @@ g_module_open (const gchar *file_name,
modules = module;
/* check initialization */
if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init))
if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init) && check_init != NULL)
check_failed = check_init (module);
/* we don't call unload() if the initialization check failed. */