]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 29 Mar 2024 08:25:40 +0000 (21:25 +1300)
commitddfbbeaabfbd98078fc1cab510701d534004fb95
treed7c364d6774ca192f34fc7c7212e2b5efa58c9d9
parent6ec0a25cbe8c42b291ef7a0096b488478b83e68f
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