tr memory corruption fix from Simon Cozens.
Jarkko Hietaniemi [Mon, 7 Aug 2000 14:45:14 +0000 (14:45 +0000)]
p4raw-id: //depot/perl@6535

doop.c

diff --git a/doop.c b/doop.c
index ba8a7e5..39d050b 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -93,8 +93,8 @@ S_do_trans_simple(pTHX_ SV *sv)
     }
     *d = '\0';
     sv_setpvn(sv, (const char*)dstart, d - dstart);
+    Safefree(dstart);
     SvUTF8_on(sv);
-    SvLEN_set(sv, 2*len+1);
     SvSETMAGIC(sv);
     return matches;
 }