aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-09-12 16:34:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-09-12 16:34:28 +0000
commit17d15ddf75d7408ca5a75e643ae767f595ff4ec8 (patch)
tree7776eec9ab18ba1e6199045cfb2a20048c9d2317
parent06e3ec7a542ede97986cbab8066b1293b1cd2751 (diff)
downloadpostgresql-17d15ddf75d7408ca5a75e643ae767f595ff4ec8.tar.gz
postgresql-17d15ddf75d7408ca5a75e643ae767f595ff4ec8.zip
Fix incorrect pfree in to_tsquery_name(), per Nigel Andrews.
-rw-r--r--contrib/tsearch2/query.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c
index 00537f4170e..458c55de279 100644
--- a/contrib/tsearch2/query.c
+++ b/contrib/tsearch2/query.c
@@ -884,22 +884,18 @@ Datum
to_tsquery_name(PG_FUNCTION_ARGS)
{
text *name = PG_GETARG_TEXT_P(0);
- Datum res = DirectFunctionCall2(
- to_tsquery,
+ Datum res = DirectFunctionCall2(to_tsquery,
Int32GetDatum(name2id_cfg(name)),
- PG_GETARG_DATUM(1)
- );
+ PG_GETARG_DATUM(1));
- PG_FREE_IF_COPY(name, 1);
+ PG_FREE_IF_COPY(name, 0);
PG_RETURN_DATUM(res);
}
Datum
to_tsquery_current(PG_FUNCTION_ARGS)
{
- PG_RETURN_DATUM(DirectFunctionCall2(
- to_tsquery,
+ PG_RETURN_DATUM(DirectFunctionCall2(to_tsquery,
Int32GetDatum(get_currcfg()),
- PG_GETARG_DATUM(0)
- ));
+ PG_GETARG_DATUM(0)));
}