]> git.lyx.org Git - features.git/commit
InsetIndex: add a missing destructor for IndexNode and call it from xhtml() to avoid...
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 8 Jan 2023 21:03:26 +0000 (22:03 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 8 Jan 2023 21:03:36 +0000 (22:03 +0100)
commit6e4cf808da4ea846d0f5195d0d684daf4912af43
tree46f9416d0432e7cc62b091771503f6fdbcc8776f
parenta71126904f6dd0c63f714926350a6d6dee42c6ef
InsetIndex: add a missing destructor for IndexNode and call it from xhtml() to avoid leaking resources.

Corresponding Coverity finding:

** CID 382778:  Resource leaks  (RESOURCE_LEAK)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1909 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()

________________________________________________________________________________________________________
*** CID 382778:  Resource leaks  (RESOURCE_LEAK)
/home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetIndex.cpp: 1909 in _ZNK3lyx15InsetPrintIndex5xhtmlB5cxx11ERNS_9XMLStreamERKNS_12OutputParamsE()
1903            }
1904
1905            xs << xml::EndTag("ul");
1906            xs << xml::CR();
1907            xs << xml::EndTag("div");
1908
>>>     CID 382778:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "index_root" going out of scope leaks the storage it points to.
1909            return ods.str();
1910     }
1911
src/insets/InsetIndex.cpp