Coverity still thinks that there is a route through do_vop that can
authorNicholas Clark <nick@ccl4.org>
Tue, 18 Apr 2006 11:18:12 +0000 (11:18 +0000)
committerNicholas Clark <nick@ccl4.org>
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 08b6c230a71c908068940cce4d20bf6870d72ede..202e320b3ce61d17076886136c758ef4ae25522d 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;