Skip to content

Commit a14fa84

Browse files
committed
Fix minor memory leak in PLy_typeinfo_dealloc().
We forgot to free the per-attribute array element descriptors. Jan Urbański
1 parent ed75380 commit a14fa84

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pl/plpython/plpy_typeio.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,20 @@ PLy_typeinfo_dealloc(PLyTypeInfo *arg)
7474
{
7575
if (arg->is_rowtype == 1)
7676
{
77+
int i;
78+
79+
for (i = 0; i < arg->in.r.natts; i++)
80+
{
81+
if (arg->in.r.atts[i].elm != NULL)
82+
PLy_free(arg->in.r.atts[i].elm);
83+
}
7784
if (arg->in.r.atts)
7885
PLy_free(arg->in.r.atts);
86+
for (i = 0; i < arg->out.r.natts; i++)
87+
{
88+
if (arg->out.r.atts[i].elm != NULL)
89+
PLy_free(arg->out.r.atts[i].elm);
90+
}
7991
if (arg->out.r.atts)
8092
PLy_free(arg->out.r.atts);
8193
}

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