]> granicus.if.org Git - postgresql/commit
Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Sep 2015 20:48:44 +0000 (16:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Sep 2015 20:48:44 +0000 (16:48 -0400)
commiteed5bbc48026976444dc020086559acc8e6f26ca
tree076a4423aade09a6c8e66c7a00b9fd7d8047bd20
parent44297a058ea05cd78b33612ce303f3caec11e3ab
Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock().

RemoveLocalLock() must consider the possibility that LockAcquireExtended()
failed to palloc the initial space for a locallock's lockOwners array.
I had evidently meant to cope with this hazard when the code was originally
written (commit 1785acebf2ed14fd66955e2d9a55d77a025f418d), but missed that
the pfree needed to be protected with an if-test.  Just to make sure things
are left in a clean state, reset numLockOwners as well.

Per low-memory testing by Andreas Seltenreich.  Back-patch to all supported
branches.
src/backend/storage/lmgr/lock.c