Commit 9287567e authored by Tom Lane's avatar Tom Lane

Fix bogus order of cleanup steps in plperl_inline_handler.

Per Alex Hunsaker
parent d38603bd
/********************************************************************** /**********************************************************************
* plperl.c - perl as a procedural language for PostgreSQL * plperl.c - perl as a procedural language for PostgreSQL
* *
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.173 2010/03/18 19:02:46 petere Exp $ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.174 2010/04/18 19:16:06 tgl Exp $
* *
**********************************************************************/ **********************************************************************/
...@@ -1153,19 +1153,20 @@ plperl_inline_handler(PG_FUNCTION_ARGS) ...@@ -1153,19 +1153,20 @@ plperl_inline_handler(PG_FUNCTION_ARGS)
} }
PG_CATCH(); PG_CATCH();
{ {
current_call_data = save_call_data;
restore_context(oldcontext);
if (desc.reference) if (desc.reference)
SvREFCNT_dec(desc.reference); SvREFCNT_dec(desc.reference);
current_call_data = save_call_data;
restore_context(oldcontext);
PG_RE_THROW(); PG_RE_THROW();
} }
PG_END_TRY(); PG_END_TRY();
current_call_data = save_call_data;
restore_context(oldcontext);
if (desc.reference) if (desc.reference)
SvREFCNT_dec(desc.reference); SvREFCNT_dec(desc.reference);
current_call_data = save_call_data;
restore_context(oldcontext);
error_context_stack = pl_error_context.previous; error_context_stack = pl_error_context.previous;
PG_RETURN_VOID(); PG_RETURN_VOID();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment