mirror of https://github.com/citusdata/citus.git
Fix the dangling pointer bug in get_merged_argument_list()
(cherry picked from commit edaf88e0ff
)
release-11.1-teja-backport-pr6507
parent
486a3b6be9
commit
3a3c037b3b
|
@ -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);
|
||||||
|
|
|
@ -491,7 +491,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;
|
||||||
|
@ -528,6 +528,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);
|
||||||
|
@ -610,6 +611,7 @@ get_merged_argument_list(CallStmt *stmt, List **mergedNamedArgList,
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pg_get_rule_expr deparses an expression and returns the result as a string.
|
* pg_get_rule_expr deparses an expression and returns the result as a string.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue