1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Modify pg_dump to use error-free memory allocation macros. This avoids

ignoring errors and call-site error checking.
This commit is contained in:
Bruce Momjian
2011-11-25 15:40:51 -05:00
parent 35e27226b6
commit 3c0afde11a
18 changed files with 1357 additions and 1361 deletions

View File

@ -23,6 +23,7 @@
*/
#include "pg_backup_archiver.h"
#include "common.h"
#include "dumputils.h"
#include <unistd.h> /* for dup */
@ -67,9 +68,7 @@ InitArchiveFmt_Null(ArchiveHandle *AH)
/* Initialize LO buffering */
AH->lo_buf_size = LOBBUFSIZE;
AH->lo_buf = (void *) malloc(LOBBUFSIZE);
if (AH->lo_buf == NULL)
die_horribly(AH, NULL, "out of memory\n");
AH->lo_buf = (void *) pg_malloc(LOBBUFSIZE);
/*
* Now prevent reading...