]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Free reference in correct Perl context. Backpatch to release 8.2. Patch from Tim...
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 12 Feb 2010 04:33:22 +0000 (04:33 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 12 Feb 2010 04:33:22 +0000 (04:33 +0000)
src/pl/plperl/plperl.c

index 5bea27ee9279c918a2282a10396a06e3a5be8f08..3c42f99dcb4d01bcb5ff16fcecca2dcd72ccd10f 100644 (file)
@@ -1,7 +1,7 @@
 /**********************************************************************
  * plperl.c - perl as a procedural language for PostgreSQL
  *
- *       $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.10 2009/12/29 17:41:25 heikki Exp $
+ *       $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.123.2.11 2010/02/12 04:33:22 adunstan Exp $
  *
  **********************************************************************/
 
@@ -1504,8 +1504,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;