Fixed #2336 (False positive: memory leak (passing pointer to subfunction))
This commit is contained in:
parent
0f9415a5fb
commit
6951c32683
|
@ -670,7 +670,7 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list<co
|
||||||
if (tok2->str() == "(" || tok2->str() == ")")
|
if (tok2->str() == "(" || tok2->str() == ")")
|
||||||
break;
|
break;
|
||||||
if (tok2->varId() == varid)
|
if (tok2->varId() == varid)
|
||||||
return "use_";
|
return (tok->strAt(-1)==".") ? "use" : "use_";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -507,6 +507,9 @@ private:
|
||||||
"const int two = rand();\n"
|
"const int two = rand();\n"
|
||||||
"return 0;\n"
|
"return 0;\n"
|
||||||
"}", "one");
|
"}", "one");
|
||||||
|
|
||||||
|
// ticket #2336: calling member function with same name as a white_list function
|
||||||
|
ASSERT_EQUALS(";;use;", getcode("char *s; foo.write(s);", "s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue