From: Goro Fuji Date: Sat, 28 Feb 2009 10:21:38 +0000 (+0100) Subject: Hash::Util::FieldHash 1.03 leaks SVs which are used as object IDs stored in mg->mg_obj X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f72763ca64e82790f7457efc913f314774e50590;p=p5sagit%2Fp5-mst-13.2.git Hash::Util::FieldHash 1.03 leaks SVs which are used as object IDs stored in mg->mg_obj --- diff --git a/ext/Hash-Util-FieldHash/FieldHash.xs b/ext/Hash-Util-FieldHash/FieldHash.xs index 919a689..ccd7c61 100644 --- a/ext/Hash-Util-FieldHash/FieldHash.xs +++ b/ext/Hash-Util-FieldHash/FieldHash.xs @@ -82,6 +82,7 @@ SV* HUF_obj_id(SV* obj) { id = HUF_OBJ_ID(item); mg = sv_magicext(item, id, PERL_MAGIC_ext, NULL, NULL, 0); mg->mg_private = HUF_IDCACHE; + SvREFCNT_dec(id); /* refcnt++ in sv_magicext() */ /* Return the object ID */ return id; diff --git a/ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm b/ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm index 25f244a..44edd1d 100644 --- a/ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm +++ b/ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm @@ -5,7 +5,7 @@ use strict; use warnings; use Scalar::Util qw( reftype); -our $VERSION = '1.03'; +our $VERSION = '1.03_01'; require Exporter; our @ISA = qw(Exporter);