]> granicus.if.org Git - postgresql/commit
Fix a bunch of places that called malloc and friends with no NULL check.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Aug 2016 22:22:43 +0000 (18:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 Aug 2016 22:22:43 +0000 (18:22 -0400)
commit052cc223d5ce1b727f62afff75797c88d82f880b
treebc60ab35a639f80fd33d8f3391558084d680dbae
parent9daec77e165de461fca9d5bc3ece86a91aba5804
Fix a bunch of places that called malloc and friends with no NULL check.

Where possible, use palloc or pg_malloc instead; otherwise, insert
explicit NULL checks.

Generally speaking, these are places where an actual OOM is quite
unlikely, either because they're in client programs that don't
allocate all that much, or they're very early in process startup
so that we'd likely have had a fork() failure instead.  Hence,
no back-patch, even though this is nominally a bug fix.

Michael Paquier, with some adjustments by me

Discussion: <CAB7nPqRu07Ot6iht9i9KRfYLpDaF2ZuUv5y_+72uP23ZAGysRg@mail.gmail.com>
12 files changed:
contrib/pg_standby/pg_standby.c
contrib/vacuumlo/vacuumlo.c
src/backend/bootstrap/bootstrap.c
src/backend/port/dynloader/darwin.c
src/backend/utils/misc/ps_status.c
src/bin/pg_archivecleanup/pg_archivecleanup.c
src/bin/psql/command.c
src/common/exec.c
src/test/isolation/isolationtester.c
src/test/isolation/specparse.y
src/test/isolation/specscanner.l
src/test/regress/pg_regress.c