]> granicus.if.org Git - postgresql/commitdiff
Fix incorrect pfree in to_tsquery_name(), per Nigel Andrews.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 12 Sep 2003 16:34:28 +0000 (16:34 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 12 Sep 2003 16:34:28 +0000 (16:34 +0000)
contrib/tsearch2/query.c

index 00537f4170ed3a005952afcfc2d085faa7bb1c3b..458c55de2798b4a6e7f767a08dc14f4aa9769d9b 100644 (file)
@@ -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)));
 }