diff --git a/src/kits/storage/Mime.cpp b/src/kits/storage/Mime.cpp index 8058be2594..d89e6f5ac9 100644 --- a/src/kits/storage/Mime.cpp +++ b/src/kits/storage/Mime.cpp @@ -311,10 +311,11 @@ get_named_icon(const char* name, BBitmap* icon, icon_size which) size_t size; type_code type; status_t status = get_named_icon(name, &data, &size, &type); - if (status == B_OK) + if (status == B_OK) { status = BIconUtils::GetVectorIcon(data, size, icon); + delete[] data; + } - delete[] data; return status; }