Coverity still thinks that there is a route through do_vop that can
Nicholas Clark [Tue, 18 Apr 2006 11:18:12 +0000 (11:18 +0000)]
leak resources. I believe that it's spotted that you can skip all the
cases in the switch. Plug that hole.

p4raw-id: //depot/perl@27883

doop.c

diff --git a/doop.c b/doop.c
index 08b6c23..202e320 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -1282,6 +1282,11 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
                *SvEND(sv) = '\0';
            Safefree(dcsave);
            break;
+       default:
+           if (sv == left || sv == right)
+               Safefree(dcorig);
+           Perl_croak(aTHX_ "panic: do_vop called for op %u (%s)", optype,
+                      PL_op_name[optype]);
        }
        SvUTF8_on(sv);
        goto finish;