Free insthandle if there's no detach function
authorAlan T. DeKok <aland@freeradius.org>
Tue, 3 Feb 2009 13:33:29 +0000 (14:33 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 3 Feb 2009 13:33:29 +0000 (14:33 +0100)
src/main/modules.c

index 91215e9..0779de4 100644 (file)
@@ -198,6 +198,8 @@ static void module_instance_free_old(CONF_SECTION *cs, module_instance_t *node,
                
                if (node->entry->module->detach) {
                        (node->entry->module->detach)(mh->insthandle);
+               } else {
+                       free(mh->insthandle);
                }
 
                *last = mh->next;