Fix incorrect pfree in to_tsquery_name(), per Nigel Andrews.

This commit is contained in:
Tom Lane 2003-09-12 16:34:28 +00:00
parent 06e3ec7a54
commit 17d15ddf75
1 changed files with 5 additions and 9 deletions

View File

@ -884,22 +884,18 @@ Datum
to_tsquery_name(PG_FUNCTION_ARGS) to_tsquery_name(PG_FUNCTION_ARGS)
{ {
text *name = PG_GETARG_TEXT_P(0); text *name = PG_GETARG_TEXT_P(0);
Datum res = DirectFunctionCall2( Datum res = DirectFunctionCall2(to_tsquery,
to_tsquery,
Int32GetDatum(name2id_cfg(name)), 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); PG_RETURN_DATUM(res);
} }
Datum Datum
to_tsquery_current(PG_FUNCTION_ARGS) to_tsquery_current(PG_FUNCTION_ARGS)
{ {
PG_RETURN_DATUM(DirectFunctionCall2( PG_RETURN_DATUM(DirectFunctionCall2(to_tsquery,
to_tsquery,
Int32GetDatum(get_currcfg()), Int32GetDatum(get_currcfg()),
PG_GETARG_DATUM(0) PG_GETARG_DATUM(0)));
));
} }