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); }