From c3a153afed84e29dac664bdc6123724a9e3a906f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 5 Jun 2004 19:48:09 +0000 Subject: 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.) --- src/backend/utils/adt/name.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/adt/name.c') diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c index ecac8d2d500..cf4f14c3e15 100644 --- a/src/backend/utils/adt/name.c +++ b/src/backend/utils/adt/name.c @@ -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) { -- cgit v1.2.3