From: Tom Lane Date: Tue, 24 May 2011 18:20:08 +0000 (-0400) Subject: Avoid uninitialized bits in the result of QTN2QT(). X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=bd9215a346da64467d9b070715bf40e412ba6b14;p=users%2Fc2main%2Fpostgres.git Avoid uninitialized bits in the result of QTN2QT(). Found with additional valgrind testing. Noah Misch --- diff --git a/src/backend/utils/adt/tsquery_util.c b/src/backend/utils/adt/tsquery_util.c index 831936696b..d4a2ede1f6 100644 --- a/src/backend/utils/adt/tsquery_util.c +++ b/src/backend/utils/adt/tsquery_util.c @@ -336,7 +336,7 @@ QTN2QT(QTNode *in) cntsize(in, &sumlen, &nnode); len = COMPUTESIZE(nnode, sumlen); - out = (TSQuery) palloc(len); + out = (TSQuery) palloc0(len); SET_VARSIZE(out, len); out->size = nnode;