From 94896e17bbd8af28aa301133635d80b55f0b7b01 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! llvm-svn: 49057 --- clang/lib/Analysis/GRSimpleVals.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/Analysis/GRSimpleVals.cpp b/clang/lib/Analysis/GRSimpleVals.cpp index a99cf312152f..5944c12e5896 100644 --- a/clang/lib/Analysis/GRSimpleVals.cpp +++ b/clang/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;