summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-09-08 12:52:14 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-09-08 13:22:20 +0000
commite11fe4290c7f0c4a876113e5e440db37ecd91bcc (patch)
tree3fec87b8710009ffcdbb478f754ca0f10b87d01d
parent602af14a7782613f1f6e4bd6492a1abf5b40806b (diff)
Fix double-free in QQmlTypePrivate for enum values
Reported by ASan. Change-Id: I8e5e6561e6e721ba7fe37a4658480d14b8c437ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/qml/qqmlmetatype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 9bc35b3b52..bddbda5832 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -815,10 +815,10 @@ void QQmlTypePrivate::insertEnumsFromPropertyCache(const QQmlPropertyCache *cach
const QMetaObject *cppMetaObject = cache->firstCppMetaObject();
while (cache && cache->metaObject() != cppMetaObject) {
- QStringHash<int> *scoped = new QStringHash<int>();
int count = cache->qmlEnumCount();
for (int ii = 0; ii < count; ++ii) {
+ QStringHash<int> *scoped = new QStringHash<int>();
QQmlEnumData *enumData = cache->qmlEnum(ii);
for (int jj = 0; jj < enumData->values.count(); ++jj) {