diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-05-01 17:04:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-05-01 17:04:38 +0000 |
commit | f5c23ca20811c62c87c35c0b45f74572b0b77955 (patch) | |
tree | 6749470c5613d6687dd9fdb0c4e13f55072ce814 /src | |
parent | 05f030837ce2b84cce6511dfba03f0f921866580 (diff) | |
download | postgresql-f5c23ca20811c62c87c35c0b45f74572b0b77955.tar.gz postgresql-f5c23ca20811c62c87c35c0b45f74572b0b77955.zip |
Fix leakage of proc-related storage in plpython's inline handler.
Per report from Andres Freund.
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpython/plpython.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index e4c32eb33a3..7ddc223dfd4 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -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); } /* |