Free reference in correct Perl context. Backpatch to release 8.2. Patch from Tim Bunce.

This commit is contained in:
Andrew Dunstan 2010-02-12 04:32:02 +00:00
parent 23eec895df
commit f7231399a4

View File

@ -1,7 +1,7 @@
/**********************************************************************
* plperl.c - perl as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.150.2.4 2009/12/29 17:41:09 heikki Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.150.2.5 2010/02/12 04:32:02 adunstan Exp $
*
**********************************************************************/
@ -1530,8 +1530,11 @@ compile_plperl_function(Oid fn_oid, bool is_trigger)
{
hash_search(plperl_proc_hash, internal_proname,
HASH_REMOVE, NULL);
if (prodesc->reference)
if (prodesc->reference) {
check_interp(prodesc->lanpltrusted);
SvREFCNT_dec(prodesc->reference);
restore_context(oldcontext);
}
free(prodesc->proname);
free(prodesc);
prodesc = NULL;