]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check dl_module->dl
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Sep 2019 13:10:23 +0000 (09:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Sep 2019 13:10:23 +0000 (09:10 -0400)
which is NULL if we tried to load a module and failed

src/lib/server/dl_module.c

index d77f8f3fcd6928c6012c7af955b67aa488dc62bb..9e2a1d2ebcb62ca1f8ff3f926bb59b3a573adcaa 100644 (file)
@@ -286,11 +286,16 @@ static void dl_module_instance_data_alloc(dl_module_inst_t *dl_inst, dl_module_t
  */
 static int _dl_module_free(dl_module_t *dl_module)
 {
-       if (DEBUG_ENABLED4) {
-               DEBUG4("%s unloaded.  Handle address %p, symbol address %p", dl_module->dl->name,
-                      dl_module->dl->handle, dl_module->common);
-       } else {
-               DEBUG3("%s unloaded", dl_module->dl->name);
+       /*
+        *      dl is empty if we tried to load it and failed.
+        */
+       if (dl_module->dl) {
+               if (DEBUG_ENABLED4) {
+                       DEBUG4("%s unloaded.  Handle address %p, symbol address %p", dl_module->dl->name,
+                              dl_module->dl->handle, dl_module->common);
+               } else {
+                       DEBUG3("%s unloaded", dl_module->dl->name);
+               }
        }
 
        if (dl_module->in_tree) {