]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not leak memory when handling cache manager requests (#1408)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 5 Jul 2023 14:41:47 +0000 (14:41 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 5 Jul 2023 18:19:43 +0000 (18:19 +0000)
commit182faab8059d973eed5d035daa61a08399badd20
tree27e3919b1ea343268e6145337b969ea68f41125a
parent15cf09067d1ede6b482368b9665e304102c15783
Do not leak memory when handling cache manager requests (#1408)

Also adjusted Cache-Control APIs to prevent similar bugs. These changes
also speed up processing a bit and simplify most of the affected code.
The now-gone "just remove the old CC" putCc() misfeature was unused.

The leak was introduced by commit 92a5adb: PutCommonResponseHeaders()
incorrectly assumed that putCc(pointerToX) takes ownership of X.

Detected by Coverity. CID 1534779: Resource leak (RESOURCE_LEAK).
src/HttpHeader.cc
src/HttpHeader.h
src/HttpReply.cc
src/cache_manager.cc
src/ftp/Elements.cc
src/http.cc
src/http/Message.cc
src/http/Message.h
src/mime.cc
src/tests/stub_HttpHeader.cc
src/tests/stub_libhttp.cc