leak in change#4694 spotted by Larry
Gurusamy Sarathy [Fri, 17 Dec 1999 19:55:03 +0000 (19:55 +0000)]
p4raw-link: @4694 on //depot/perl: 94f7643d7f26ed53393f1ab3452245da43de285e

p4raw-id: //depot/perl@4696

hv.c

diff --git a/hv.c b/hv.c
index 8431cf7..9b01db7 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -503,7 +503,7 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, U32 klen, I32 flags)
        if (flags & G_DISCARD)
            sv = Nullsv;
        else {
-           sv = HeVAL(entry);
+           sv = sv_2mortal(HeVAL(entry));
            HeVAL(entry) = &PL_sv_undef;
        }
        if (entry == xhv->xhv_eiter)
@@ -579,7 +579,7 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
        if (flags & G_DISCARD)
            sv = Nullsv;
        else {
-           sv = HeVAL(entry);
+           sv = sv_2mortal(HeVAL(entry));
            HeVAL(entry) = &PL_sv_undef;
        }
        if (entry == xhv->xhv_eiter)