Patch by Argiris Kirtzidis: Fix a dangling pointer error!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49057 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index a99cf31..5944c12 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -76,10 +76,12 @@
ITERATOR I, ITERATOR E, const char* msg) {
std::ostringstream Out;
+ std::string Str;
if (!PD) {
Out << "[CHECKER] " << msg;
- msg = Out.str().c_str();
+ Str = Out.str();
+ msg = Str.c_str();
}
bool isFirst = true;