lwp: Avoid freeing 'stackmemory' on AIX32 27/13427/2
authorAndrew Deason <adeason@sinenomine.net>
Mon, 14 Jan 2019 23:12:27 +0000 (17:12 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 25 Jan 2019 14:38:26 +0000 (09:38 -0500)
commit97f830605d5f251c58382c3f9febc4d98e949ee8
treef11cd904f061cc7d446ac1a87ae66f71062b2622
parent4c5daaa26fbe2fd7e24ceba475e60e5e5c765e78
lwp: Avoid freeing 'stackmemory' on AIX32

Commit 55013a11 (lwp: Fix possible memory leak from scan-build) added
some free() calls to some otherwise-leaked memory. However, one of
these calls frees the 'stackmemory' pointer, which on AIX32 is not a
pointer from malloc/calloc, but calculated from reserveFromStack().

To avoid corrupting the heap, skip this free call on AIX32. This
commit adds another #ifdef to avoid this, which is unfortunate, but
this is also how the free is avoided in the existing code for
Free_PCB().

Reviewed-on: https://gerrit.openafs.org/13426
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f6182922455aa0cbee19d138b0827eb87dc2b7ce)

Change-Id: Id32eea373799c0cb43fb01a98210a0800899a1d6
Reviewed-on: https://gerrit.openafs.org/13427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/lwp/lwp.c