summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 2996a8e88b..5443771fea 100644
--- a/hv.c
+++ b/hv.c
@@ -1596,6 +1596,7 @@ S_hfreeentries(pTHX_ HV *hv)
HvLAZYDEL_off(hv);
hv_free_ent(hv, entry);
}
+ Safefree(iter->xhv_name);
Safefree(iter);
((XPVHV*) SvANY(hv))->xhv_aux = 0;
}
@@ -1772,7 +1773,9 @@ Perl_hv_name_set(pTHX_ HV *hv, const char *name, STRLEN len, int flags)
{
struct xpvhv_aux *iter = ((XPVHV *)SvANY(hv))->xhv_aux;
- if (!iter) {
+ if (iter) {
+ Safefree(iter->xhv_name);
+ } else {
if (name == 0)
return;