mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Tweak palloc/repalloc to allow zero bytes to be requested, as per recent
proposal. Eliminate several dozen now-unnecessary hacks to avoid palloc(0). (It's likely there are more that I didn't find.)
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/name.c,v 1.52 2004/05/30 23:40:35 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/name.c,v 1.53 2004/06/05 19:48:09 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -358,9 +358,7 @@ current_schemas(PG_FUNCTION_ARGS)
|
||||
int i;
|
||||
ArrayType *array;
|
||||
|
||||
/* +1 here is just to avoid palloc(0) error */
|
||||
|
||||
names = (Datum *) palloc((list_length(search_path) + 1) * sizeof(Datum));
|
||||
names = (Datum *) palloc(list_length(search_path) * sizeof(Datum));
|
||||
i = 0;
|
||||
foreach(l, search_path)
|
||||
{
|
||||
|
Reference in New Issue
Block a user