Comment user provided input memory allocation (#4163)

pull/4164/head^2
SaitTalhaNisanci 2020-09-17 13:18:13 +03:00 committed by GitHub
parent 4118560b75
commit 5723038f74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -112,7 +112,12 @@ master_run_on_worker(PG_FUNCTION_ARGS)
"function return type are not compatible")));
}
/* prepare storage for status and result values */
/*
* prepare storage for status and result values.
* commandCount is based on user input however, it is the length of list
* instead of a user given integer, hence this should be safe here in terms
* of memory allocation.
*/
bool *statusArray = palloc0(commandCount * sizeof(bool));
StringInfo *resultArray = palloc0(commandCount * sizeof(StringInfo));
for (int commandIndex = 0; commandIndex < commandCount; commandIndex++)