diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-10-08 03:52:32 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-10-08 03:52:32 +0000 |
commit | bdae05f5d106e215ca84857478716b6ae1cbf967 (patch) | |
tree | 079760a8c91311c1d3f9a25bc0d818b4082435f2 /src/bin/pg_dump/pg_backup_custom.c | |
parent | b8382c26884f4adcf525e0bc7fdf0c671d57b84d (diff) |
Use calloc() to allocate empty structures.
Fix pg_restore tar log output bug where Special flag wasn't being
initialized; bug seen on XP.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_custom.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_custom.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index 802b02811f5..8f207a0331f 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -19,7 +19,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.25 2003/08/04 00:43:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.26 2003/10/08 03:52:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -136,7 +136,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH) /* * Set up some special context used in compressing data. */ - ctx = (lclContext *) malloc(sizeof(lclContext)); + ctx = (lclContext *) calloc(1, sizeof(lclContext)); if (ctx == NULL) die_horribly(AH, modulename, "out of memory\n"); AH->formatData = (void *) ctx; @@ -253,7 +253,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (ctx == NULL) { - ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry)); + ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry)); te->formatData = (void *) ctx; } |