*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/*
* 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;
if (ctx == NULL)
{
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
te->formatData = (void *) ctx;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.21 2002/10/25 01:33:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.22 2003/10/08 03:52:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* 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;
lclTocEntry *ctx;
char fn[K_STD_BUF_SIZE];
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
if (te->dataDumper)
{
#ifdef HAVE_LIBZ
if (ctx == NULL)
{
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
te->formatData = (void *) ctx;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/*
* 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);
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
if (ctx == NULL)
{
- ctx = (lclTocEntry *) malloc(sizeof(lclTocEntry));
+ ctx = (lclTocEntry *) calloc(1, sizeof(lclTocEntry));
te->formatData = (void *) ctx;
}
* by PostgreSQL
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.352 2003/09/27 22:10:01 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.353 2003/10/08 03:52:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
write_msg(NULL, "preparing to dump the contents of table %s\n",
classname);
- dumpCtx = (DumpContext *) malloc(sizeof(DumpContext));
+ dumpCtx = (DumpContext *) calloc(1, sizeof(DumpContext));
dumpCtx->tblinfo = (TableInfo *) tblinfo;
dumpCtx->tblidx = i;
dumpCtx->oids = oids;
*numFuncs = ntups;
- finfo = (FuncInfo *) malloc(ntups * sizeof(FuncInfo));
-
- memset((char *) finfo, 0, ntups * sizeof(FuncInfo));
+ finfo = (FuncInfo *) calloc(ntups, sizeof(FuncInfo));
i_oid = PQfnumber(res, "oid");
i_proname = PQfnumber(res, "proname");
* dumping only one, because we don't yet know which tables might be
* inheritance ancestors of the target table.
*/
- tblinfo = (TableInfo *) malloc(ntups * sizeof(TableInfo));
- memset(tblinfo, 0, ntups * sizeof(TableInfo));
+ tblinfo = (TableInfo *) calloc(ntups, sizeof(TableInfo));
i_reloid = PQfnumber(res, "oid");
i_relname = PQfnumber(res, "relname");