]> granicus.if.org Git - postgresql/commit
Fix set of issues with memory-allocation system calls in frontend code
authorMichael Paquier <michael@paquier.xyz>
Sat, 4 May 2019 07:32:19 +0000 (16:32 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 4 May 2019 07:32:19 +0000 (16:32 +0900)
commit84e4570da9230d45022ef77f98b560f26eaf6916
tree3601a8698654004066409b44d7c50fecedb95fea
parent34ff542a71f8e8e768b24d40548dec4be0c707c3
Fix set of issues with memory-allocation system calls in frontend code

Like the backend, the frontend has wrappers on top of malloc() and such
whose use is recommended.  Particularly, it is possible to do memory
allocation without issuing an error.  Some binaries missed the use of
those wrappers, so let's fix the gap for consistency.

This also fixes two latent bugs:
- In pg_dump/pg_dumpall when parsing an ACL item, on an out-of-memory
error for strdup(), the code considered the failure as a ACL parsing
problem instead of an actual OOM.
- In pg_waldump, an OOM when building the target directory string would
cause a crash.

Author: Daniel Gustafsson
Discussion: https://postgr.es/m/gY0y9xenfoBPc-Tufsr2Zg-MmkrJslm0Tw_CMg4p_j58-k_PXNC0klMdkKQkg61BkXC9_uWo-DcUzfxnHqpkpoR5jjVZrPHqKYikcHIiONhg=@yesql.se
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/dumputils.c
src/bin/pg_test_fsync/pg_test_fsync.c
src/bin/pg_waldump/pg_waldump.c
src/bin/psql/large_obj.c