Skip to content
Snippets Groups Projects
Commit a14fa846 authored by Tom Lane's avatar Tom Lane
Browse files

Fix minor memory leak in PLy_typeinfo_dealloc().

We forgot to free the per-attribute array element descriptors.

Jan Urbański
parent ed75380b
No related branches found
No related tags found
No related merge requests found
...@@ -74,8 +74,20 @@ PLy_typeinfo_dealloc(PLyTypeInfo *arg) ...@@ -74,8 +74,20 @@ PLy_typeinfo_dealloc(PLyTypeInfo *arg)
{ {
if (arg->is_rowtype == 1) 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) if (arg->in.r.atts)
PLy_free(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) if (arg->out.r.atts)
PLy_free(arg->out.r.atts); PLy_free(arg->out.r.atts);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment