From: Francesco Chemolli Date: Mon, 26 Nov 2012 10:24:10 +0000 (-0700) Subject: Fix TextException: gracefully handle exceptions with null text messages. X-Git-Tag: SQUID_3_2_4~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57dcdeec0ba5f0ef2b3012aff4866bdab976aa1f;p=thirdparty%2Fsquid.git Fix TextException: gracefully handle exceptions with null text messages. --- diff --git a/src/base/TextException.cc b/src/base/TextException.cc index ef66a37931..849acd8ce7 100644 --- a/src/base/TextException.cc +++ b/src/base/TextException.cc @@ -17,7 +17,7 @@ TextException::TextException(const TextException& right) : } TextException::TextException(const char *aMsg, const char *aFileName, int aLineNo, unsigned int anId): - message(xstrdup(aMsg)), theFileName(aFileName), theLineNo(aLineNo), theId(anId) + message(aMsg?xstrdup(aMsg):NULL), theFileName(aFileName), theLineNo(aLineNo), theId(anId) {} TextException::~TextException() throw()