From a32114b15cd0558a64f1ecf1acf29430945061e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 6 May 2009 21:31:31 +0200 Subject: [PATCH] memleak: removed false positives for pclose (#286) --- src/checkmemoryleak.cpp | 2 +- test/testmemleak.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index c407db8d4..abcde6f5c 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -486,7 +486,7 @@ Token *CheckMemoryLeakClass::getcode(const Token *tok, std::list } } - if (Token::Match(tok->previous(), "[;{})] %var%")) + if (Token::Match(tok->previous(), "[;{})=] %var%")) { AllocType dealloc = GetDeallocationType(tok, varnames); if (dealloc != No) diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 3bb06feff..cd6eeaa00 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -2119,7 +2119,7 @@ private: " FILE *f = popen (\"test\", \"w\");\n" " int a = pclose(f);\n" "}\n"); - TODO_ASSERT_EQUALS(std::string(""), errout.str()); + ASSERT_EQUALS(std::string(""), errout.str()); } };