]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pbx: ast_custom_function_unregister resource leak
authorScott Griepentrog <sgriepentrog@digium.com>
Fri, 14 Feb 2014 21:53:38 +0000 (21:53 +0000)
committerScott Griepentrog <sgriepentrog@digium.com>
Fri, 14 Feb 2014 21:53:38 +0000 (21:53 +0000)
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

main/pbx.c

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