diff -ruN DBD-Pg-1.31.orig/Pg.xs DBD-Pg-1.31/Pg.xs --- DBD-Pg-1.31.orig/Pg.xs 2003-10-29 13:13:32.000000000 -0800 +++ DBD-Pg-1.31/Pg.xs 2004-02-17 01:55:03.000000000 -0800 @@ -70,7 +70,7 @@ #TODO: make quote(foo, {type=>SQL_INTEGER}) work #rl #TODO: make quote(foo, {pg_type=>DBD::Pg::PG_INTEGER}) work #rl -void +SV* quote(dbh, to_quote_sv, type_sv=Nullsv) SV* dbh SV* to_quote_sv @@ -104,17 +104,19 @@ if (!SvOK(to_quote_sv)) { quoted = "NULL"; len = 4; - ST(0) = sv_2mortal(newSVpv(quoted,len)); + RETVAL = newSVpvn(quoted,len); } else { if (SvMAGICAL(to_quote_sv)) mg_get(to_quote_sv); to_quote = SvPV(to_quote_sv, len); quoted = type_info->quote(to_quote, len, &retlen); - ST(0) = sv_2mortal(newSVpv(quoted, retlen)); - free (quoted); + RETVAL = newSVpvn(quoted, retlen); + Safefree (quoted); } } + OUTPUT: + RETVAL diff -ruN DBD-Pg-1.31.orig/quote.c DBD-Pg-1.31/quote.c --- DBD-Pg-1.31.orig/quote.c 2003-10-29 13:13:32.000000000 -0800 +++ DBD-Pg-1.31/quote.c 2004-02-17 02:26:23.000000000 -0800 @@ -373,7 +373,7 @@ strcpy(dest,intermead); strcat(dest,"\'"); - safefree(intermead); + PQfreemem(intermead); *retlen=strlen(result); assert(*retlen+1 <= resultant_len+2);