diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-13 13:28:11 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-03-13 13:28:11 -0400 |
commit | a14fa84693659c4c4a17204406945b29fae3d9c4 (patch) | |
tree | d6ff496629b81e0405efbc437b9103bfc983caeb /src | |
parent | ed75380bdae30dc1313aef44beafad860cf246c0 (diff) | |
download | postgresql-a14fa84693659c4c4a17204406945b29fae3d9c4.tar.gz postgresql-a14fa84693659c4c4a17204406945b29fae3d9c4.zip |
Fix minor memory leak in PLy_typeinfo_dealloc().
We forgot to free the per-attribute array element descriptors.
Jan UrbaĆski
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpython/plpy_typeio.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c index 1cc9b1e210e..d04fe46d4b7 100644 --- 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); } |