From 643ddd4caa1d2fc1fe495722778989253856bbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 17 Dec 2018 18:54:32 +0100 Subject: [PATCH] Code cleanup --- lib/checkmemoryleak.cpp | 13 ------------- test/testmemleak.cpp | 9 +++------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 6aa3fe37f..8d05c462c 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -573,19 +573,6 @@ void CheckMemoryLeakInFunction::checkReallocUsage() //--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- -// Checks for memory leaks inside function.. -//--------------------------------------------------------------------------- - -static bool isInMemberFunc(const Scope* scope) -{ - while (scope->nestedIn && !scope->functionOf) - scope = scope->nestedIn; - - return (scope->functionOf != nullptr); -} - - //--------------------------------------------------------------------------- // Checks for memory leaks in classes.. //--------------------------------------------------------------------------- diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 386f950d6..8d7f29543 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -156,8 +156,8 @@ private: LOAD_LIB_2(settings1.library, "std.cfg"); LOAD_LIB_2(settings1.library, "posix.cfg"); LOAD_LIB_2(settings2.library, "std.cfg"); + return; -/* TEST_CASE(simple5); TEST_CASE(simple7); TEST_CASE(simple9); // Bug 2435468 - member function "free" @@ -369,7 +369,6 @@ private: TEST_CASE(crash); TEST_CASE(trac7680); TEST_CASE(trac7440); -*/ } @@ -5526,10 +5525,9 @@ private: void run() override { LOAD_LIB_2(settings.library, "gtk.cfg"); settings.addEnabled("all"); -/* + return; TEST_CASE(glib1); TEST_CASE(glib2); // #2806 - FP when using redundant assignment -*/ } void glib1() { @@ -5640,11 +5638,10 @@ private: void run() override { LOAD_LIB_2(settings.library, "windows.cfg"); -/* + return; TEST_CASE(openfileNoLeak); TEST_CASE(returnValueNotUsed_tfopen_s); TEST_CASE(sendMessage); -*/ } void openfileNoLeak() {