Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by

Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>
This commit is contained in:
Teodor Sigaev 2009-07-28 09:33:09 +00:00
parent 4b284aff65
commit a142498e76

View File

@ -174,12 +174,12 @@ dropvoidsubtree(QTNode * root)
root->nchild = j;
if (root->valnode->val == (int4) '!' && root->nchild == 0)
if (root->nchild == 0)
{
QTNFree(root);
root = NULL;
}
else if (root->nchild == 1)
else if (root->nchild == 1 && root->valnode->val != (int4) '!')
{
QTNode *nroot = root->child[0];