summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_tar.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-10-08 03:52:32 +0000
committerBruce Momjian <bruce@momjian.us>2003-10-08 03:52:32 +0000
commitbdae05f5d106e215ca84857478716b6ae1cbf967 (patch)
tree079760a8c91311c1d3f9a25bc0d818b4082435f2 /src/bin/pg_dump/pg_backup_tar.c
parentb8382c26884f4adcf525e0bc7fdf0c671d57b84d (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_tar.c')
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 88e1595787f..8cf9b15e1b8 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.37 2003/08/04 00:43:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.38 2003/10/08 03:52:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -158,10 +158,11 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
/*
* Set up some special context used in compressing data.
*/
- ctx = (lclContext *) malloc(sizeof(lclContext));
+ ctx = (lclContext *) calloc(1, sizeof(lclContext));
AH->formatData = (void *) ctx;
ctx->filePos = 0;
-
+ ctx->isSpecialScript = 0;
+
/* Initialize LO buffering */
AH->lo_buf_size = LOBBUFSIZE;
AH->lo_buf = (void *) malloc(LOBBUFSIZE);
@@ -253,7 +254,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te)
lclTocEntry *ctx;
char fn[K_STD_BUF_SIZE];
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
if (te->dataDumper != NULL)
{
#ifdef HAVE_LIBZ
@@ -292,7 +293,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te)
if (ctx == NULL)
{
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
te->formatData = (void *) ctx;
}