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,9 +311,11 @@ AddMimeTypeString(BObjectList<BString> &list, Model *model)
|
|||||||
// only add the type if it's not already there
|
// only add the type if it's not already there
|
||||||
for (int32 i = list.CountItems(); i-- > 0;) {
|
for (int32 i = list.CountItems(); i-- > 0;) {
|
||||||
BString *string = list.ItemAt(i);
|
BString *string = list.ItemAt(i);
|
||||||
if (string != NULL && !string->ICompare(*mimeType))
|
if (string != NULL && !string->ICompare(*mimeType)) {
|
||||||
|
delete mimeType;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
list.AddItem(mimeType);
|
list.AddItem(mimeType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user