From 8d449661cabc6ccab0681f6b2c2143b2547ab535 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Wed, 1 Jul 2015 21:42:16 -0400 Subject: [PATCH] CID 743867: Memleak in DiskUsage --- src/apps/diskusage/Scanner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index 0129fea22a..ac551c91e3 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -230,8 +230,10 @@ Scanner::_GetFileInfo(BDirectory* dir, FileInfo* parent) thisDir->count = 0; while (true) { - if (fQuitRequested) + if (fQuitRequested) { + delete thisDir; return NULL; + } if (dir->GetNextEntry(&entry) == B_ENTRY_NOT_FOUND) break;