dlclose driver handles on mod_detach (rlm_cache)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 16 Nov 2014 19:07:12 +0000 (14:07 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 22 Nov 2014 14:20:58 +0000 (09:20 -0500)
src/modules/rlm_cache/rlm_cache.c

index 6df7485..b8cf7b6 100644 (file)
@@ -580,6 +580,12 @@ static int mod_detach(void *instance)
 
        talloc_free(inst->maps);
 
+       /*
+        *  Decrements the reference count. The driver object won't be unloaded
+        *  until all instances of rlm_cache that use it have been destroyed.
+        */
+       if (inst->handle) dlclose(inst->handle);
+
        return 0;
 }