diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-18 18:44:16 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-18 20:17:18 -0800 |
commit | cc34d8c5166167fcc3b2144eab4efb369901f305 (patch) | |
tree | bb13d80c8cde4e7f760f061ff06b33a26719747f /utf8.c | |
parent | 2fd63cc5b615213574e0153ed2bf14d9df23c073 (diff) | |
download | perl-cc34d8c5166167fcc3b2144eab4efb369901f305.tar.gz |
utf8.c: Fix a minor refcounting bug caused by 02c8547
Under some circumstances it could cause a hash to point to a freed
element. But the hash itself was leaking, so it caused on problems,
as no attempt to free its element again was made.
The next commit will stop the hash from leaking.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2998,6 +2998,9 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m { Perl_croak(aTHX_ "panic: hv_store() unexpectedly failed"); } + /* We just stole a reference count. */ + if (swash_invlist_unclaimed) swash_invlist_unclaimed = FALSE; + else SvREFCNT_inc_simple_void_NN(swash_invlist); } if ((int) _invlist_len(swash_invlist) <= invlist_swash_boundary) { |