From 6923a09001431c94d29db8275adf199913a06810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 8 Oct 2009 22:30:33 +0200 Subject: [PATCH] memory leaks: minor cleanups --- src/checkmemoryleak.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index c04d7e0ac..88166a7bf 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -1447,13 +1447,6 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all) done = false; } - // Replace "dealloc use ;" with "dealloc ;" - if (Token::simpleMatch(tok2, "dealloc use ;")) - { - Token::eraseTokens(tok2, tok2->tokAt(2)); - done = false; - } - // Remove the "if break|continue ;" that follows "dealloc ; alloc ;" if (! _settings->_showAll && Token::Match(tok2, "dealloc ; alloc ; if break|continue ;")) { @@ -1711,13 +1704,7 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all) const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens, bool all) { - const Token *result = 0; - - // No allocation at all => no leaks - if (Token::findmatch(tokens, "alloc") == 0) - { - return NULL; - } + const Token *result; if ((result = Token::findmatch(tokens, "loop alloc ;")) != NULL) {