summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-15 17:00:52 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-15 17:00:52 -0800
commitecbbcad639528457f99648a7a5576d629350122e (patch)
tree038380c6a01255b245a81be55c45b8896c97d69b /hv.c
parent47f1cf770212f10b8ffbc1777e95c1dbfe120c9d (diff)
downloadperl-ecbbcad639528457f99648a7a5576d629350122e.tar.gz
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.
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c4
1 files changed, 2 insertions, 2 deletions
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);
}