Skip to content

Commit

Permalink
lldb doesn't like this
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Nov 17, 2014
1 parent 2c54c50 commit ba9905d
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions src/main/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ static int module_instance_cmp(void const *one, void const *two)
}


static void module_instance_free_old(UNUSED CONF_SECTION *cs, module_instance_t *node,
time_t when)
static void module_instance_free_old(UNUSED CONF_SECTION *cs, module_instance_t *node, time_t when)
{
fr_module_hup_t *mh, **last;

Expand Down Expand Up @@ -369,40 +368,33 @@ static void module_instance_free_old(UNUSED CONF_SECTION *cs, module_instance_t
*/
static void module_instance_free(void *data)
{
module_instance_t *this = data;
module_instance_t *module = talloc_get_type_abort(data, module_instance_t);

module_instance_free_old(this->cs, this, time(NULL) + 100);
module_instance_free_old(module->cs, module, time(NULL) + 100);

#ifdef HAVE_PTHREAD_H
if (this->mutex) {
if (module->mutex) {
/*
* FIXME
* The mutex MIGHT be locked...
* we'll check for that later, I guess.
*/
pthread_mutex_destroy(this->mutex);
talloc_free(this->mutex);
pthread_mutex_destroy(module->mutex);
talloc_free(module->mutex);
}
#endif

/*
* Remove any registered paircompares.
*/
paircompare_unregister_instance(this->insthandle);

xlat_unregister(this->name, NULL, this->insthandle);
paircompare_unregister_instance(module->insthandle);

xlat_unregister(module->name, NULL, module->insthandle);
/*
* Remove all xlat's registered to this instance.
* Remove all xlat's registered to module instance.
*/
if (this->insthandle) {
xlat_unregister_module(this->insthandle);
}

#ifndef NDEBUG
memset(this, 0, sizeof(*this));
#endif
talloc_free(this);
if (module->insthandle) xlat_unregister_module(module->insthandle);
talloc_free(module);
}


Expand Down

0 comments on commit ba9905d

Please sign in to comment.