CID 996. Don't leak the BString

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27744 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2008-09-25 14:23:39 +00:00
parent 2e2f53f614
commit 84dcf4f24f
+3 -1
View File
@@ -311,8 +311,10 @@ AddMimeTypeString(BObjectList<BString> &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);
}