Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static bool isLocalVarNoAutoDealloc(const Token *varTok, const bool isCpp)

static const Token * isFunctionCall(const Token * nameToken)
{
if (nameToken->isName()) {
if (!nameToken->isStandardType() && nameToken->isName()) {
nameToken = nameToken->next();
// check if function is a template
if (nameToken && nameToken->link() && nameToken->str() == "<") {
Expand Down
8 changes: 8 additions & 0 deletions test/testleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class TestLeakAutoVar : public TestFixture {
TEST_CASE(configuration2);
TEST_CASE(configuration3);
TEST_CASE(configuration4);
TEST_CASE(configuration5);

TEST_CASE(ptrptr);

Expand Down Expand Up @@ -2356,6 +2357,13 @@ class TestLeakAutoVar : public TestFixture {
ASSERT_EQUALS("[test.c:4]: (information) --check-library: Function set_data() should have <use>/<leak-ignore> configuration\n", errout.str());
}

void configuration5() {
check("void f() {\n"
" int(i);\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}

void ptrptr() {
check("void f() {\n"
" char **p = malloc(10);\n"
Expand Down