]> git.ipfire.org Git - thirdparty/squid.git/commit - src/adaptation/icap/ModXact.cc
Partial bug #2964 fix: Prevent memory leaks when ICAP transactions fail.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 11 Sep 2010 23:59:07 +0000 (17:59 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sat, 11 Sep 2010 23:59:07 +0000 (17:59 -0600)
commitc7d51c86241d69feb80d219eebc56f08c88464fb
tree503e7d6811e50d09bdd47fe8669f47cd6f2020ae
parentf3630c679fd4f86fec1137378d140dee485f182c
Partial bug #2964 fix: Prevent memory leaks when ICAP transactions fail.

We now make sure that heap-allocated objects are deleted if an exception
is thrown before the object pointers are saved/registered in a safe location
like a data member.

Assigning state.serviceWaiting=true after calling callWhenReady() in ModXact
prevents ModXact leak when callWhenReady() throws. This may need more work
to mark ModXact state appropriately for the adaptation log.

TODO: Convert other HttpMsg pointer members to use safe HttpMsg::Pointer.
src/adaptation/icap/ModXact.cc
src/adaptation/icap/ModXact.h
src/adaptation/icap/OptXact.cc
src/adaptation/icap/OptXact.h
src/adaptation/icap/Xaction.cc
src/adaptation/icap/Xaction.h