aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmemoryprofiler.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@jollamobile.com>2013-12-03 22:16:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 11:42:44 +0100
commit102f57376f5d1ace2e9a3e0ffa829a1bbc0d002c (patch)
tree288325994000606c6afc6e407a030545b15e2837 /src/qml/qml/qqmlmemoryprofiler.cpp
parent3131cad718733591787877642afe194ee8a3eb03 (diff)
QQmlMemoryProfiler: Fix dangling pointer use.
toUtf8 returns a temporary, accessing constData isn't safe Change-Id: I3c4d077f24cee0eaf1df230c4d8079619967b51a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlmemoryprofiler.cpp')
-rw-r--r--src/qml/qml/qqmlmemoryprofiler.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlmemoryprofiler.cpp b/src/qml/qml/qqmlmemoryprofiler.cpp
index e7b6653532..d93276fc17 100644
--- a/src/qml/qml/qqmlmemoryprofiler.cpp
+++ b/src/qml/qml/qqmlmemoryprofiler.cpp
@@ -100,8 +100,7 @@ static bool openLibrary()
QQmlMemoryScope::QQmlMemoryScope(const QUrl &url) : pushed(false)
{
if (openLibrary() && memprofile_is_enabled()) {
- const char *location = url.path().toUtf8().constData();
- memprofile_push_location(location, 0);
+ memprofile_push_location(url.path().toUtf8().constData(), 0);
pushed = true;
}
}