Skip to content

Commit f5c23ca

Browse files
committed
Fix leakage of proc-related storage in plpython's inline handler.
Per report from Andres Freund.
1 parent 05f0308 commit f5c23ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pl/plpython/plpython.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.142 2010/04/30 19:15:45 tgl Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.143 2010/05/01 17:04:38 tgl Exp $
55
*
66
*********************************************************************
77
*/
@@ -541,12 +541,15 @@ plpython_inline_handler(PG_FUNCTION_ARGS)
541541
}
542542
PG_CATCH();
543543
{
544+
PLy_procedure_delete(proc);
544545
PLy_curr_procedure = save_curr_proc;
545546
PyErr_Clear();
546547
PG_RE_THROW();
547548
}
548549
PG_END_TRY();
549550

551+
PLy_procedure_delete(proc);
552+
550553
/* Pop the error context stack */
551554
error_context_stack = plerrcontext.previous;
552555

@@ -1664,6 +1667,7 @@ PLy_procedure_delete(PLyProcedure *proc)
16641667
}
16651668
if (proc->argnames)
16661669
PLy_free(proc->argnames);
1670+
PLy_free(proc);
16671671
}
16681672

16691673
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy