From ecbbcad639528457f99648a7a5576d629350122e Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 15 Nov 2010 17:00:52 -0800 Subject: Fix memory leak introduced by 2d0d1eccfcfe If HvENAME was set by a destructor, it needs to be freed as well. hv_name_set(whatever, NULL, ...) does that. --- hv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hv.c') diff --git a/hv.c b/hv.c index c3db1c622c..aa06c620f8 100644 --- a/hv.c +++ b/hv.c @@ -1855,8 +1855,8 @@ Perl_hv_undef(pTHX_ HV *hv) if (SvOOK(hv)) { struct xpvhv_aux * const aux = HvAUX(hv); struct mro_meta *meta; - if ((name = HvNAME(hv))) { - if (PL_stashcache) + if (aux->xhv_name) { + if (PL_stashcache && (name = HvNAME(hv))) (void)hv_delete(PL_stashcache, name, HvNAMELEN_get(hv), G_DISCARD); hv_name_set(hv, NULL, 0, 0); } -- cgit v1.2.1