From 84dcf4f24f4547ffcbbbaf8e1b9eaa9b86e158e4 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 25 Sep 2008 14:23:39 +0000 Subject: [PATCH] CID 996. Don't leak the BString git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27744 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/ContainerWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 84902409c1..58c8f19f1a 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -311,8 +311,10 @@ AddMimeTypeString(BObjectList &list, Model *model) // only add the type if it's not already there for (int32 i = list.CountItems(); i-- > 0;) { BString *string = list.ItemAt(i); - if (string != NULL && !string->ICompare(*mimeType)) + if (string != NULL && !string->ICompare(*mimeType)) { + delete mimeType; return; + } } list.AddItem(mimeType); }