Skip to content

Commit cef3244

Browse files
committed
Remove dead code in CheckMemoryLeakInFunction::call_func() (Coverity CID 1257017)
1 parent 03fcac9 commit cef3244

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/checkmemoryleak.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list<co
606606
}
607607

608608
// how many parameters is there in the function call?
609-
unsigned int numpar = countParameters(tok);
609+
const unsigned int numpar = countParameters(tok);
610610
if (numpar == 0) {
611611
// Taking return value => it is not a noreturn function
612612
if (tok->strAt(-1) == "=")
@@ -636,8 +636,6 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list<co
636636

637637
for (; tok; tok = tok->nextArgument()) {
638638
++par;
639-
if (varid == 0)
640-
continue;
641639
if (Token::Match(tok, "%varid% [,()]", varid)) {
642640
if (dot)
643641
return "use";

0 commit comments

Comments
 (0)