]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug fix in TextException: gracefully handle exceptions with null text messages.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 14 Nov 2012 18:17:09 +0000 (19:17 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 14 Nov 2012 18:17:09 +0000 (19:17 +0100)
src/base/TextException.cc

index 555433b3ab3dd8bf03fa30237afc8ccb39b0fce3..c18f2cc5c8df78e4a4f5dd4f33565830211b8703 100644 (file)
@@ -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()