Skip Menu |

This queue is for tickets about the TDB_File CPAN distribution.

Report information
The Basics
Id: 17378
Status: resolved
Priority: 0/
Queue: TDB_File

People
Owner: Nobody in particular
Requestors: nigelw [...] elder-gods.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.90
Fixed in: (no value)



Subject: TDB_DATA conversion to SV leaks memory
Using TDB_File in a long-lived process results in runaway memory use. This is because every time we do a fetch, the data that is returned is never freed (which the tdb_fetch(3) manpage tells us we need to do) Patch is attached.
Subject: tdb_file.patch
diff -r -U 3 TDB_File-0.90/typemap TDB_File-0.90.noleak/typemap --- TDB_File-0.90/typemap 2005-06-20 23:16:36.000000000 +0000 +++ TDB_File-0.90.noleak/typemap 2006-01-31 01:08:33.000000000 +0000 @@ -30,9 +30,10 @@ ############################################################################# OUTPUT T_TDB_DATA - if ($var.dptr) + if ($var.dptr) { sv_setpvn((SV*)$arg, $var.dptr, $var.dsize); - else + free($var.dptr); + } else $arg = &PL_sv_undef; # note use of "class" string: T_PTROBJ_CLASS
Fixed in 0.96, thanks for the patch. Sorry for the delay.