• Tom Lane's avatar
    Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock(). · ba51774d
    Tom Lane authored
    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 1785aceb), 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.
    ba51774d
lock.c 121 KB