]> granicus.if.org Git - clang/commitdiff
Patch by Argiris Kirtzidis: Fix a dangling pointer error!
authorTed Kremenek <kremenek@apple.com>
Tue, 1 Apr 2008 22:35:58 +0000 (22:35 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 1 Apr 2008 22:35:58 +0000 (22:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49057 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRSimpleVals.cpp

index a99cf312152f3248037f83248b48f0686352ec9f..5944c12e5896c5f9a9b7cec11c5ac484856eb745 100644 (file)
@@ -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;