This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mg_free frees data but leaves it accessible
authorYuval Kogman <nothingmuch@woobling.org>
Fri, 21 Dec 2007 00:13:31 +0000 (02:13 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 21 Dec 2007 10:21:45 +0000 (10:21 +0000)
Message-ID: <20071220221331.GG10631@woobling.org>
Date: Fri, 21 Dec 2007 00:13:31 +0200

p4raw-id: //depot/perl@32686

mg.c

diff --git a/mg.c b/mg.c
index 4a6c689..f341f23 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -497,6 +497,7 @@ Perl_mg_free(pTHX_ SV *sv)
        if (mg->mg_flags & MGf_REFCOUNTED)
            SvREFCNT_dec(mg->mg_obj);
        Safefree(mg);
+       SvMAGIC_set(sv, moremagic);
     }
     SvMAGIC_set(sv, NULL);
     return 0;