From a6fb4e07ed2e9145596490240faa1eebff5a53c0 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 Apr 2008 22:35:58 +0000 Subject: [PATCH] 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 --- lib/Analysis/GRSimpleVals.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp index a99cf31215..5944c12e58 100644 --- a/lib/Analysis/GRSimpleVals.cpp +++ b/lib/Analysis/GRSimpleVals.cpp @@ -76,10 +76,12 @@ void EmitWarning(Diagnostic& Diag, PathDiagnosticClient* PD, 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; -- 2.50.1