Skip to content

Commit

Permalink
quick hack to ensure the proc tree is always freed
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Oct 22, 2015
1 parent 0824cc6 commit 5ff707b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/map_proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef int (*map_proc_instantiate_t)(void *proc_inst, void *mod_inst, vp_tmpl_t

map_proc_t *map_proc_find(char const *name);

void map_proc_free(void);
int map_proc_register(void *mod_inst, char const *name,
map_proc_func_t evaluate,
xlat_escape_t escape,
Expand Down
5 changes: 5 additions & 0 deletions src/main/map_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ map_proc_t *map_proc_find(char const *name)
return rbtree_finddata(map_proc_root, &find);
}

void map_proc_free(void)
{
TALLOC_FREE(map_proc_root);
}

/** Register a map processor
*
* This should be called by every module that provides a map processing function.
Expand Down
5 changes: 5 additions & 0 deletions src/main/radiusd.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@ int main(int argc, char *argv[])
*/
main_config_free();

/*
* Free the map processor tree
*/
map_proc_free();

#ifdef WIN32
WSACleanup();
#endif
Expand Down

0 comments on commit 5ff707b

Please sign in to comment.