pbx: ast_custom_function_unregister resource leak

In pbx.c ast_custom_function_unregister(), a list
of escalations being removed from the list wasn't
being free'd creating a leak. This patch corrects
that by freeing the records.

Review: https://reviewboard.asterisk.org/r/3213/
Reported by: Corey Farrell
Patches:
     acf_escalating_leak.patch uploaded by coreyfarrell (license 5909)
........

Merged revisions 408142 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@408143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/61/61/1
Scott Griepentrog 12 years ago
parent 016326c992
commit 8387e420b9

@ -3957,6 +3957,7 @@ int ast_custom_function_unregister(struct ast_custom_function *acf)
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&escalation_root, cur_escalation, list) { AST_RWLIST_TRAVERSE_SAFE_BEGIN(&escalation_root, cur_escalation, list) {
if (cur_escalation->acf == acf) { if (cur_escalation->acf == acf) {
AST_RWLIST_REMOVE_CURRENT(list); AST_RWLIST_REMOVE_CURRENT(list);
ast_free(cur_escalation);
break; break;
} }
} }

Loading…
Cancel
Save