Fix the dangling pointer bug in get_merged_argument_list()

(cherry picked from commit edaf88e0ff)
release-11.0-teja-backport-pr6507
Teja Mupparti 2022-11-21 16:58:06 -08:00
parent 96e20ee42e
commit 9aea377ce5
1 changed files with 2 additions and 1 deletions

View File

@ -482,7 +482,7 @@ get_merged_argument_list(CallStmt *stmt, List **mergedNamedArgList,
Oid functionOid = stmt->funcexpr->funcid; Oid functionOid = stmt->funcexpr->funcid;
List *namedArgList = NIL; List *namedArgList = NIL;
List *finalArgumentList = NIL; List *finalArgumentList = NIL;
Oid finalArgTypes[FUNC_MAX_ARGS]; Oid *finalArgTypes;
Oid *argTypes = NULL; Oid *argTypes = NULL;
char *argModes = NULL; char *argModes = NULL;
char **argNames = NULL; char **argNames = NULL;
@ -519,6 +519,7 @@ get_merged_argument_list(CallStmt *stmt, List **mergedNamedArgList,
/* Remove the duplicate INOUT counting */ /* Remove the duplicate INOUT counting */
numberOfArgs = numberOfArgs - totalInoutArgs; numberOfArgs = numberOfArgs - totalInoutArgs;
finalArgTypes = palloc0(sizeof(Oid) * numberOfArgs);
ListCell *inArgCell = list_head(stmt->funcexpr->args); ListCell *inArgCell = list_head(stmt->funcexpr->args);
ListCell *outArgCell = list_head(stmt->outargs); ListCell *outArgCell = list_head(stmt->outargs);