From 3d65935d2d306426ec67fb78b7cd8db95ef6944d Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Fri, 12 Sep 2008 06:10:56 +0000 Subject: [PATCH] Fixed CID 1294 and 1295: delete the entry_ref on the terminating conditions. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27433 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/text_search/GrepWindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/apps/text_search/GrepWindow.cpp b/src/apps/text_search/GrepWindow.cpp index 2d1be1e387..cd1209edc3 100644 --- a/src/apps/text_search/GrepWindow.cpp +++ b/src/apps/text_search/GrepWindow.cpp @@ -1733,8 +1733,10 @@ GrepWindow::_AreAllFoldersOpenInTracker(BList *folderList) if (status == B_OK) windowList.AddItem(static_cast(tracker_ref)); - if (status != B_OK) + if (status != B_OK) { + delete tracker_ref; break; + } } int32 folderCount = folderList->CountItems(); @@ -1830,8 +1832,10 @@ GrepWindow::_SelectFilesInTracker(BList* folderList, BMessage* refsMessage) entry_ref *windowRef = new entry_ref; status = windowReplyMessage.FindRef("result", windowRef); - if (status != B_OK) + if (status != B_OK) { + delete windowRef; break; + } int32 folderCount = folderList->CountItems();