diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-08 23:54:33 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-01-08 23:54:33 +0000 |
commit | d460ef459c7692518f607c250b9843bea7e01dd6 (patch) | |
tree | cd24ec8713445a650364342ffc6a12cadb0ba9a4 /mg.c | |
parent | 372b2723c1b440727154f21dc614ca857f429e6c (diff) | |
download | perl-d460ef459c7692518f607c250b9843bea7e01dd6.tar.gz |
Fix "scalars leaked" bugs caused by overload magic
(Highlighted by Ilya's DESTROY optimization.)
p4raw-id: //depot/perlio@8371
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -313,11 +313,12 @@ Perl_mg_free(pTHX_ SV *sv) moremagic = mg->mg_moremagic; if (vtbl && vtbl->svt_free) CALL_FPTR(vtbl->svt_free)(aTHX_ sv, mg); - if (mg->mg_ptr && mg->mg_type != 'g') + if (mg->mg_ptr && mg->mg_type != 'g') { if (mg->mg_len >= 0) Safefree(mg->mg_ptr); else if (mg->mg_len == HEf_SVKEY) SvREFCNT_dec((SV*)mg->mg_ptr); + } if (mg->mg_flags & MGf_REFCOUNTED) SvREFCNT_dec(mg->mg_obj); Safefree(mg); @@ -326,6 +327,7 @@ Perl_mg_free(pTHX_ SV *sv) return 0; } + #if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) #include <signal.h> #endif |