diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/config_info.c | 2 | ||||
-rw-r--r-- | src/common/controldata_utils.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/common/config_info.c b/src/common/config_info.c index aa643b63fe2..891a1505ccf 100644 --- a/src/common/config_info.c +++ b/src/common/config_info.c @@ -39,7 +39,7 @@ get_configdata(const char *my_exec_path, size_t *configdata_len) /* Adjust this to match the number of items filled below */ *configdata_len = 23; - configdata = (ConfigData *) palloc(*configdata_len * sizeof(ConfigData)); + configdata = palloc_array(ConfigData, *configdata_len); configdata[i].name = pstrdup("BINDIR"); strlcpy(path, my_exec_path, sizeof(path)); 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 |