summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2009-07-28 09:33:09 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2009-07-28 09:33:09 +0000
commita142498e76a74b64ea03b13809db96c7c5e6f62e (patch)
treee4542e02cb1d83c5d864ad02c6f218149b4fd69c
parent4b284aff655f6150cf4791151c249d33b9bb3c02 (diff)
Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by
Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>
-rw-r--r--contrib/tsearch2/query_rewrite.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/tsearch2/query_rewrite.c b/contrib/tsearch2/query_rewrite.c
index 63d8140a6c2..2b917373112 100644
--- a/contrib/tsearch2/query_rewrite.c
+++ b/contrib/tsearch2/query_rewrite.c
@@ -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];