afsmonitor: avoid double free on exit 61/13161/7
authorPat Riehecky <riehecky@fnal.gov>
Wed, 6 Jun 2018 15:01:02 +0000 (10:01 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 19 Apr 2019 14:37:17 +0000 (10:37 -0400)
commit3d22ce36dcb86df564d4d91ff0e174792b30d68f
tree6a8826a3da730ecf1121645cc54ef82192ce7b75
parent1b835d1c1a5d4a838ab1344abc6615626a28b715
afsmonitor: avoid double free on exit

The afsmonitor may leak memory and do a double free on shutdown when it
was started with a non-zero -buffers parameter value. The deallocation
of the cm results circular buffer incorrectly frees the base of the
array of results instead of each result.  The fs buffer clean up got
this right.

This fixes the clang scan-build warning:

    afsmonitor.c:461:7: warning: Attempt to free released memory
                        free(tmp_cmlist);
                        ^~~~~~~~~~~~~~~~

[mmeffie: update code and commit message]

Change-Id: Ifd4ea5b9b865f04e5cf88560dd8a9dfdbe7e32cb
Reviewed-on: https://gerrit.openafs.org/13161
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afsmonitor/afsmonitor.c