]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3803: ident leaks memory on failure
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Oct 2014 18:01:46 +0000 (11:01 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Oct 2014 18:01:46 +0000 (11:01 -0700)
commit20a17bdd3d35e4ea2b052206eae3936b7aa7be42
treef7044f78a00ca2702a319923bda674388eb433a2
parent0546971e6e7f73e474ed1c444554b36016a83929
Bug 3803: ident leaks memory on failure

Begin the process of conversion for IdentStateData to an AsyncJob.

* convert the object from CBDATA struct to a class with
CBDATA_CLASS2() API.

* Bug 3803 is caused by a lack of proper cleanup and consistent exit
actions terminating the job. Take the core logic changes from the
tested bug patch and;

 1) define a swanSong() method to cleanup the memory allocated

 2) define a deleteThis() method to emulate AsyncJob::deleteThis()

* Locate all code paths leveraging conn->close() to trigger cleanup
via the connection close handler and convert to explicit deleteThis()
with excuse. Including a few which were not but need to in order to
terminate the job correctly as fixed in bug 3803 patch.

The actions performed are nearly identical to the original code. The
differences are that many code paths now omit an AsyncCall step going
via the Comm close handler, and that all paths terminating the IDENT
lookup now go through swanSong() cleanup.

Further cleanup converting to a full AsyncJob is not included, since
there is an explicit hash of running IdentStateData object pointers
being used in the old code.
src/ident/Ident.cc