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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user