diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-05-30 16:40:03 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-05-30 16:40:03 +0200 |
commit | e3b1b6b13da71d3dc75cea4d4ff56f2468a6f7e5 (patch) | |
tree | 5efc95db60ee489b8c54aef35cd5c5464e9ceecc /hv.c | |
parent | 9ef5ed94af316c852dd085d2cbe8306867ac870b (diff) | |
download | perl-e3b1b6b13da71d3dc75cea4d4ff56f2468a6f7e5.tar.gz |
Nicholas says that SvREFCNT_dec should be sufficient here
(instead of marking the SV as mortal.)
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1443,8 +1443,10 @@ Perl_hv_copy_hints_hv(pTHX_ HV *const ohv) hv_iterinit(ohv); while ((entry = hv_iternext_flags(ohv, 0))) { SV *const sv = newSVsv(HeVAL(entry)); + SV *heksv = newSVhek(HeKEY_hek(entry)); sv_magic(sv, NULL, PERL_MAGIC_hintselem, - (char *)sv_2mortal(newSVhek (HeKEY_hek(entry))), HEf_SVKEY); + (char *)heksv, HEf_SVKEY); + SvREFCNT_dec(heksv); (void)hv_store_flags(hv, HeKEY(entry), HeKLEN(entry), sv, HeHASH(entry), HeKFLAGS(entry)); } |