diff options
| author | Tom Lane | 2012-03-13 17:28:11 +0000 |
|---|---|---|
| committer | Tom Lane | 2012-03-13 17:28:11 +0000 |
| commit | a14fa84693659c4c4a17204406945b29fae3d9c4 (patch) | |
| tree | d6ff496629b81e0405efbc437b9103bfc983caeb /src/pl | |
| parent | ed75380bdae30dc1313aef44beafad860cf246c0 (diff) | |
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/pl')
| -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); } |
