Skip to content

Commit

Permalink
Don't segv if we didn't managed to load one of the eap methods
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 21, 2013
1 parent 08a70c1 commit e06a68e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/rlm_eap/eap.c
Expand Up @@ -76,7 +76,11 @@ static int eap_module_free(void *ctx)

inst = talloc_get_type_abort(ctx, eap_module_t);

if (inst->type->detach) (inst->type->detach)(inst->instance);
/*
* We have to check inst->type as it's only allocated
* if we loaded the eap method.
*/
if (inst->type && inst->type->detach) (inst->type->detach)(inst->instance);

#ifndef NDEBUG
/*
Expand Down

0 comments on commit e06a68e

Please sign in to comment.