Fix memory leak in QDomDocument DTD notation declaration handler
authorSami Rosendahl <ext-sami.1.rosendahl@nokia.com>
Thu, 5 Jan 2012 11:52:39 +0000 (13:52 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 6 Jan 2012 01:59:55 +0000 (02:59 +0100)
commit1bc31fa43ddefe468c9f079156bfad0371e2a61b
treef67c0c6614bf81cedbbda9d23a95055eb75cf136
parent17cc46a9a73a419619f2c13f26ef228325aa4a85
Fix memory leak in QDomDocument DTD notation declaration handler

The created notation node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Also added autotest DTDNotationDecl
to tst_qdom to expose the leak when executed under valgrind memcheck.
There was no previous test coverage for the notation declarations in DTD.

Task-number: QTBUG-22588
Change-Id: I876186d1277ceb4414f803b58b62f51cc1474367
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/xml/dom/qdom.cpp
tests/auto/xml/dom/qdom/tst_qdom.cpp