summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-06-03 14:14:15 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-06-04 07:20:50 +0000
commit9e08ecb816471ecbdbcb0e8abbf639c61e6c0428 (patch)
tree2516641c7c1a2b46f3d4ea1202658654d834fe0e /src/plugins/cppeditor
parentf899c49dca0ffe3ea1540af3c9934f658494e3c7 (diff)
downloadqt-creator-9e08ecb816471ecbdbcb0e8abbf639c61e6c0428.tar.gz
CppEditor: Fix access to dangling pointer
Found by coverity. Change-Id: I4b73af9b22b80953b4ba6c1004884862c9bdd3b8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index 24c43d24ca..7c3f210d1b 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -1983,7 +1983,7 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA
// Find the enclosing scope
int line, column;
- const Document::Ptr &doc = interface.semanticInfo().doc;
+ const Document::Ptr doc = interface.semanticInfo().doc;
doc->translationUnit()->getTokenStartPosition(nameAst->firstToken(), &line, &column);
Scope *scope = doc->scopeAt(line, column);
if (!scope)