From: Eduard Bagdasaryan Date: Tue, 25 Sep 2018 14:42:01 +0000 (+0000) Subject: cloneReply() "reply == NULL" assertion when denying replies (#292) X-Git-Tag: M-staged-PR293~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1efcaae5b55aeb52aa52fae3e9f0970c3729c2c;p=thirdparty%2Fsquid.git cloneReply() "reply == NULL" assertion when denying replies (#292) Commit e2cc8c0 lost argument nullification when converting old HTTPMSGUNLOCK() macro into a function. This change restores that important part of the HTTPMSGUNLOCK() API without sacrificing argument type checks added during that conversion. --- diff --git a/src/http/Message.h b/src/http/Message.h index 53c4bbbd6b..b11d99adf8 100644 --- a/src/http/Message.h +++ b/src/http/Message.h @@ -16,6 +16,7 @@ #include "http/ProtocolVersion.h" #include "http/StatusCode.h" #include "HttpHeader.h" +#include namespace Http { @@ -143,9 +144,11 @@ protected: } // namespace Http +template inline void -HTTPMSGUNLOCK(Http::Message *a) +HTTPMSGUNLOCK(M *&a) { + static_assert(std::is_base_of::value, "M must inherit from Http::Message"); if (a) { if (a->unlock() == 0) delete a;