From 6bb88c8ee524e981b081862de269dbea5ba06ff8 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Tue, 3 Feb 2026 10:28:25 +1100 Subject: [PATCH v2] modify malloc for pg_backup_directory.c --- src/bin/pg_dump/pg_backup_directory.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index cd4036ead82..d6a1428c67a 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -140,7 +140,7 @@ InitArchiveFmt_Directory(ArchiveHandle *AH) AH->WorkerJobDumpPtr = _WorkerJobDumpDirectory; /* Set up our private context */ - ctx = (lclContext *) pg_malloc0(sizeof(lclContext)); + ctx = pg_malloc0_object(lclContext); AH->formatData = ctx; ctx->dataFH = NULL; @@ -200,7 +200,7 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te) lclTocEntry *tctx; char fn[MAXPGPATH]; - tctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); + tctx = pg_malloc0_object(lclTocEntry); if (strcmp(te->desc, "BLOBS") == 0) { snprintf(fn, MAXPGPATH, "blobs_%d.toc", te->dumpId); @@ -252,7 +252,7 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te) if (tctx == NULL) { - tctx = (lclTocEntry *) pg_malloc0(sizeof(lclTocEntry)); + tctx = pg_malloc0_object(lclTocEntry); te->formatData = tctx; } @@ -769,7 +769,7 @@ _Clone(ArchiveHandle *AH) { lclContext *ctx = (lclContext *) AH->formatData; - AH->formatData = (lclContext *) pg_malloc(sizeof(lclContext)); + AH->formatData = pg_malloc_object(lclContext); memcpy(AH->formatData, ctx, sizeof(lclContext)); ctx = (lclContext *) AH->formatData; -- 2.47.3