1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-06 19:59:18 +03:00

Fix leakage of proc-related storage in plpython's inline handler.

Per report from Andres Freund.
This commit is contained in:
Tom Lane 2010-05-01 17:04:38 +00:00
parent 05f030837c
commit f5c23ca208

View File

@ -1,7 +1,7 @@
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.142 2010/04/30 19:15:45 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.143 2010/05/01 17:04:38 tgl Exp $
*
*********************************************************************
*/
@ -541,12 +541,15 @@ plpython_inline_handler(PG_FUNCTION_ARGS)
}
PG_CATCH();
{
PLy_procedure_delete(proc);
PLy_curr_procedure = save_curr_proc;
PyErr_Clear();
PG_RE_THROW();
}
PG_END_TRY();
PLy_procedure_delete(proc);
/* Pop the error context stack */
error_context_stack = plerrcontext.previous;
@ -1664,6 +1667,7 @@ PLy_procedure_delete(PLyProcedure *proc)
}
if (proc->argnames)
PLy_free(proc->argnames);
PLy_free(proc);
}
/*