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;