Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bee9aef

Browse files
committed
Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond.
1 parent ae9a07b commit bee9aef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/pl/plperl/plperl.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* ENHANCEMENTS, OR MODIFICATIONS.
3434
*
3535
* IDENTIFICATION
36-
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.78 2005/06/22 16:45:51 tgl Exp $
36+
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.79 2005/07/03 21:56:16 tgl Exp $
3737
*
3838
**********************************************************************/
3939

@@ -1327,14 +1327,16 @@ plperl_hash_from_tuple(HeapTuple tuple, TupleDesc tupdesc)
13271327
getTypeOutputInfo(tupdesc->attrs[i]->atttypid,
13281328
&typoutput, &typisvarlena);
13291329

1330-
outputstr = DatumGetCString(OidFunctionCall1(typoutput,
1331-
attr));
1330+
outputstr = DatumGetCString(OidFunctionCall1(typoutput, attr));
13321331

13331332
sv = newSVpv(outputstr, 0);
13341333
#if PERL_BCDVERSION >= 0x5006000L
1335-
if (GetDatabaseEncoding() == PG_UTF8) SvUTF8_on(sv);
1334+
if (GetDatabaseEncoding() == PG_UTF8)
1335+
SvUTF8_on(sv);
13361336
#endif
13371337
hv_store(hv, attname, namelen, sv, 0);
1338+
1339+
pfree(outputstr);
13381340
}
13391341

13401342
return newRV_noinc((SV *) hv);

0 commit comments

Comments
 (0)