1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Use calloc() to allocate empty structures.

Fix pg_restore tar log output bug where Special flag wasn't being
initialized; bug seen on XP.
This commit is contained in:
Bruce Momjian
2003-10-08 03:52:32 +00:00
parent b8382c2688
commit bdae05f5d1
4 changed files with 17 additions and 19 deletions

View File

@ -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;
}