Fix off-by-one bug in LWLockRegisterTranche().

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 4bfc5f1396b18da3a0db73e4406badc4ce793a1e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2014-04-25T19:59:57Z
Releases: 9.4.0
Fix off-by-one bug in LWLockRegisterTranche().

Original coding failed to enlarge the array as required if
the requested tranche_id was equal to LWLockTranchesAllocated.

In passing, fix poor style of not casting the result of (re)palloc.

Files

PathChange+/−
src/backend/storage/lmgr/lwlock.c modified +7 −5