diff options
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r-- | src/backend/executor/functions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 84be37c7a39..6c3eff7c584 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -896,9 +896,9 @@ postquel_sub_params(SQLFunctionCachePtr fcache, if (fcache->paramLI == NULL) { - /* 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; |