This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47f1cf7
)
Fix memory leak introduced by 2d0d1eccfcfe
author
Father Chrysostomos
<sprout@cpan.org>
Tue, 16 Nov 2010 01:00:52 +0000
(17:00 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Tue, 16 Nov 2010 01:00:52 +0000
(17:00 -0800)
If HvENAME was set by a destructor, it needs to be freed as well.
hv_name_set(whatever, NULL, ...) does that.
hv.c
patch
|
blob
|
blame
|
history
diff --git
a/hv.c
b/hv.c
index
c3db1c6
..
aa06c62
100644
(file)
--- 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);
}