aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickstackview.cpp
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2017-10-24 18:54:27 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2017-10-25 10:02:33 +0000
commit4c0aac07d422e8bce9dfc7f8345e2af62217e886 (patch)
treeddcaaefd1c8a81a426ba78e886f0ca2544abc1b8 /src/quicktemplates2/qquickstackview.cpp
parentc08964f0bb6b2622f94b377679d6689e6d960017 (diff)
Fix resource leak
The system resource will not be reclaimed and reused, reducing the future availability of the resource. In QQuickStackView::​componentComplete(): Leak of memory or pointers to system resources (CWE-404) Coverity-Id: 178431 Change-Id: Iff8f8e2d228042789faae56512fd3255c3e56498 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickstackview.cpp')
-rw-r--r--src/quicktemplates2/qquickstackview.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp
index ea4e36d0..20e3c817 100644
--- a/src/quicktemplates2/qquickstackview.cpp
+++ b/src/quicktemplates2/qquickstackview.cpp
@@ -996,6 +996,7 @@ void QQuickStackView::componentComplete()
element = QQuickStackElement::fromString(d->initialItem.toString(), this, &error);
if (!error.isEmpty()) {
d->warn(error);
+ delete element;
} else if (d->pushElement(element)) {
emit depthChanged();
d->setCurrentItem(element);