You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Work around unportable behavior of malloc(0) and realloc(NULL, 0).
On some platforms these functions return NULL, rather than the more commonpractice of returning a pointer to a zero-sized block of memory. Hack ourvarious wrapper functions to hide the difference by substituting a sizerequest of 1. This is probably not so important for the callers, whoshould never touch the block anyway if they asked for size 0 --- but it'simportant for the wrapper functions themselves, which mistakenly treatedthe NULL result as an out-of-memory failure. This broke at least pg_dumpfor the case of no user-defined aggregates, as per report fromMatthew Carrington.Back-patch to 9.2 to fix the pg_dump issue. Given the lack of previouscomplaints, it seems likely that there is no live bug in previous releases,even though some of these functions were in place before that.