From 5015e1e1b58f81a036e4ad16291ef4b3bb7a596c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 12 Sep 2022 08:31:56 +0200 Subject: Assorted examples of expanded type-safer palloc/pg_malloc API This adds some uses of the new palloc/pg_malloc variants here and there as a demonstration and test. This is kept separate from the actual API patch, since the latter might be backpatched at some point. Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/bb755632-2a43-d523-36f8-a1e7a389a907@enterprisedb.com --- src/common/controldata_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/controldata_utils.c') diff --git a/src/common/controldata_utils.c b/src/common/controldata_utils.c index 4c0da6e124e..66168543a6e 100644 --- a/src/common/controldata_utils.c +++ b/src/common/controldata_utils.c @@ -59,7 +59,7 @@ get_controlfile(const char *DataDir, bool *crc_ok_p) AssertArg(crc_ok_p); - ControlFile = palloc(sizeof(ControlFileData)); + ControlFile = palloc_object(ControlFileData); snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir); #ifndef FRONTEND -- cgit v1.2.3