From 102f57376f5d1ace2e9a3e0ffa829a1bbc0d002c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 3 Dec 2013 22:16:27 +0100 Subject: QQmlMemoryProfiler: Fix dangling pointer use. toUtf8 returns a temporary, accessing constData isn't safe Change-Id: I3c4d077f24cee0eaf1df230c4d8079619967b51a Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlmemoryprofiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml') 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; } } -- cgit v1.2.3