This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Hash::Util::FieldHash 1.03 leaks SVs which are used as object IDs stored in mg->mg_obj
authorGoro Fuji <g.psy.va@gmail.com>
Sat, 28 Feb 2009 10:21:38 +0000 (11:21 +0100)
committerVincent Pit <perl@profvince.com>
Sat, 28 Feb 2009 10:23:08 +0000 (11:23 +0100)
ext/Hash-Util-FieldHash/FieldHash.xs
ext/Hash-Util-FieldHash/lib/Hash/Util/FieldHash.pm

index 919a689..ccd7c61 100644 (file)
@@ -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;
index 25f244a..44edd1d 100644 (file)
@@ -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);