]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix memory leak when unloading XML documentation
authorMatthew Jordan <mjordan@digium.com>
Sun, 4 Nov 2012 00:55:19 +0000 (00:55 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 4 Nov 2012 00:55:19 +0000 (00:55 +0000)
This patch is a modified version of a patch originally committed for the
Asterisk 11 branch in r375756.  A portion of that patch, that fixed the
memory leak during unloading XML documentation, applies to branches 1.8
and 10 as well.

The patch for this issue was modified for these two branches.

(issue ASTERISK-20648)
Reported by: Corey Farrell
Tested by: mjordan
patches:
  xmldoc-memory_leak.patch uploaded by Corey Farrell (license 5909)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@375759 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/xmldoc.c

index cee70499a7fd9f3d1d8fef60316fa243962246cf..125cd240b9ef7966eddbc75d685cc31508ae68c4 100644 (file)
@@ -1944,6 +1944,7 @@ static void xmldoc_unload_documentation(void)
        while ((doctree = AST_RWLIST_REMOVE_HEAD(&xmldoc_tree, entry))) {
                ast_free(doctree->filename);
                ast_xml_close(doctree->doc);
+               ast_free(doctree);
        }
        AST_RWLIST_UNLOCK(&xmldoc_tree);