projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed75380
)
Fix minor memory leak in PLy_typeinfo_dealloc().
author
Tom Lane
<tgl@sss.pgh.pa.us>
Tue, 13 Mar 2012 17:28:11 +0000
(13:28 -0400)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Tue, 13 Mar 2012 17:28:11 +0000
(13:28 -0400)
We forgot to free the per-attribute array element descriptors.
Jan UrbaĆski
src/pl/plpython/plpy_typeio.c
patch
|
blob
|
blame
|
history
diff --git
a/src/pl/plpython/plpy_typeio.c
b/src/pl/plpython/plpy_typeio.c
index 1cc9b1e210e09b3e2b962a75c7d80468ce4ab915..d04fe46d4b77ebf3f116f8879ebe00466bf5c371 100644
(file)
--- a/
src/pl/plpython/plpy_typeio.c
+++ b/
src/pl/plpython/plpy_typeio.c
@@
-74,8
+74,20
@@
PLy_typeinfo_dealloc(PLyTypeInfo *arg)
{
if (arg->is_rowtype == 1)
{
+ int i;
+
+ for (i = 0; i < arg->in.r.natts; i++)
+ {
+ if (arg->in.r.atts[i].elm != NULL)
+ PLy_free(arg->in.r.atts[i].elm);
+ }
if (arg->in.r.atts)
PLy_free(arg->in.r.atts);
+ for (i = 0; i < arg->out.r.natts; i++)
+ {
+ if (arg->out.r.atts[i].elm != NULL)
+ PLy_free(arg->out.r.atts[i].elm);
+ }
if (arg->out.r.atts)
PLy_free(arg->out.r.atts);
}