More valgrind findings: e.g. t/op/utfhash.t.
Jarkko Hietaniemi [Sun, 28 Apr 2002 01:55:10 +0000 (01:55 +0000)]
p4raw-id: //depot/perl@16238

hv.c

diff --git a/hv.c b/hv.c
index 919a5d5..6d8461f 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1935,6 +1935,7 @@ Perl_hv_iterkeysv(pTHX_ register HE *entry)
 
             sv = newSVpvn ((char*)as_utf8, utf8_len);
             SvUTF8_on (sv);
+           Safefree (as_utf8); /* bytes_to_utf8() allocates a new string */
         } else {
             sv = newSVpvn_share(HEK_KEY(hek),
                                 (HEK_UTF8(hek) ? -HEK_LEN(hek) : HEK_LEN(hek)),