Patch by Argiris Kirtzidis: Fix a dangling pointer error!

llvm-svn: 49057
This commit is contained in:
Ted Kremenek 2008-04-01 22:35:58 +00:00
parent 7f7edc3824
commit 94896e17bb
1 changed files with 3 additions and 1 deletions

View 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;