[perl #30509] use encoding and "eq" cause memory leak
Dave Mitchell [Mon, 28 Jun 2004 22:50:01 +0000 (22:50 +0000)]
Perl_sv_eq() was creating a temp and not always freeing it

p4raw-id: //depot/perl@23006

sv.c

diff --git a/sv.c b/sv.c
index 371d17e..db872e1 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6639,8 +6639,10 @@ Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2)
                   pv1 = SvPV(svrecode, cur1);
              }
              /* Now both are in UTF-8. */
-             if (cur1 != cur2)
+             if (cur1 != cur2) {
+                  SvREFCNT_dec(svrecode);
                   return FALSE;
+             }
         }
         else {
              bool is_utf8 = TRUE;