aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r--src/backend/executor/spi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 4b86e910df8..b3c05025bc0 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -2290,9 +2290,8 @@ _SPI_convert_params(int nargs, Oid *argtypes,
{
int i;
- /* sizeof(ParamListInfoData) includes the first array element */
- paramLI = (ParamListInfo) palloc(sizeof(ParamListInfoData) +
- (nargs - 1) * sizeof(ParamExternData));
+ paramLI = (ParamListInfo) palloc(offsetof(ParamListInfoData, params) +
+ nargs * sizeof(ParamExternData));
/* we have static list of params, so no hooks needed */
paramLI->paramFetch = NULL;
paramLI->paramFetchArg = NULL;