Commit abd1ec42 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix resource leak

Variable anchor going out of scope leaks the storage it points to
if anchor->anchorType() == KoShapeAnchor::AnchorPage.

CID:248749
parent f006b593
...@@ -1480,6 +1480,7 @@ KoShape *KoTextLoader::loadShape(const KoXmlElement &element, QTextCursor &curso ...@@ -1480,6 +1480,7 @@ KoShape *KoTextLoader::loadShape(const KoXmlElement &element, QTextCursor &curso
// page anchored shapes are handled differently // page anchored shapes are handled differently
if (anchor->anchorType() == KoShapeAnchor::AnchorPage) { if (anchor->anchorType() == KoShapeAnchor::AnchorPage) {
// nothing else to do // nothing else to do
delete anchor;
} else if (anchor->anchorType() == KoShapeAnchor::AnchorAsCharacter) { } else if (anchor->anchorType() == KoShapeAnchor::AnchorAsCharacter) {
KoAnchorInlineObject *anchorObject = new KoAnchorInlineObject(anchor); KoAnchorInlineObject *anchorObject = new KoAnchorInlineObject(anchor);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment