*** pgsql/contrib/ltree/ltree_io.c 2007/02/28 22:44:38 1.14 --- pgsql/contrib/ltree/ltree_io.c 2008/04/11 22:52:17 1.14.2.1 *************** *** 1,7 **** /* * in/out function for ltree and lquery * Teodor Sigaev ! * $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.13 2006/09/22 21:39:57 tgl Exp $ */ #include "ltree.h" --- 1,7 ---- /* * in/out function for ltree and lquery * Teodor Sigaev ! * $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.14 2007/02/28 22:44:38 tgl Exp $ */ #include "ltree.h" *************** ltree_in(PG_FUNCTION_ARGS) *** 118,124 **** errmsg("syntax error"), errdetail("Unexpected end of line."))); ! result = (ltree *) palloc(LTREE_HDRSIZE + totallen); SET_VARSIZE(result, LTREE_HDRSIZE + totallen); result->numlevel = lptr - list; curlevel = LTREE_FIRST(result); --- 118,124 ---- errmsg("syntax error"), errdetail("Unexpected end of line."))); ! result = (ltree *) palloc0(LTREE_HDRSIZE + totallen); SET_VARSIZE(result, LTREE_HDRSIZE + totallen); result->numlevel = lptr - list; curlevel = LTREE_FIRST(result); *************** lquery_in(PG_FUNCTION_ARGS) *** 208,215 **** } num++; ! curqlevel = tmpql = (lquery_level *) palloc(ITEMSIZE * num); ! memset((void *) tmpql, 0, ITEMSIZE * num); ptr = buf; while (*ptr) { --- 208,214 ---- } num++; ! curqlevel = tmpql = (lquery_level *) palloc0(ITEMSIZE * num); ptr = buf; while (*ptr) { *************** lquery_in(PG_FUNCTION_ARGS) *** 448,454 **** curqlevel = NEXTLEV(curqlevel); } ! result = (lquery *) palloc(totallen); SET_VARSIZE(result, totallen); result->numlevel = num; result->firstgood = 0; --- 447,453 ---- curqlevel = NEXTLEV(curqlevel); } ! result = (lquery *) palloc0(totallen); SET_VARSIZE(result, totallen); result->numlevel = num; result->firstgood = 0;