summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-24 15:21:48 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-24 15:21:48 +0000
commit16580ff596d3844ac4e62fa769c913cc47285a8f (patch)
treecea76a1c44dfc053f2505d4d5f51d1e4b103ecbf /hv.c
parent1cf743e1eac3cc540e4c4d1b0d3ee4753fd60329 (diff)
downloadperl-16580ff596d3844ac4e62fa769c913cc47285a8f.tar.gz
Leaking is bad, m'kay.
p4raw-id: //depot/perl@24566
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;