Ticket #9902: 0018-Fix-double-free.patch

File 0018-Fix-double-free.patch, 801 bytes (added by mt, 11 years ago)

Patch

  • src/kits/storage/Mime.cpp

    From 39faad63007be7b20e9e9cb9c1d9a04dbdd41262 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Sun, 28 Jul 2013 09:24:49 +0900
    Subject: [PATCH] Fix double free
    
    ---
     src/kits/storage/Mime.cpp |    5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/src/kits/storage/Mime.cpp b/src/kits/storage/Mime.cpp
    index 8058be2..d89e6f5 100644
    a b get_named_icon(const char* name, BBitmap* icon, icon_size which)  
    311311    size_t size;
    312312    type_code type;
    313313    status_t status = get_named_icon(name, &data, &size, &type);
    314     if (status == B_OK)
     314    if (status == B_OK) {
    315315        status = BIconUtils::GetVectorIcon(data, size, icon);
     316        delete[] data;
     317    }
    316318
    317     delete[] data;
    318319    return status;
    319320}
    320321