summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-18 18:44:16 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-18 20:17:18 -0800
commitcc34d8c5166167fcc3b2144eab4efb369901f305 (patch)
treebb13d80c8cde4e7f760f061ff06b33a26719747f /utf8.c
parent2fd63cc5b615213574e0153ed2bf14d9df23c073 (diff)
downloadperl-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index bde7f87fc7..62b9135c03 100644
--- a/utf8.c
+++ b/utf8.c
@@ -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) {