Ticket #10232: 0001-Fixed-resource-leak-line-2023-nameCopy-not-freed.patch

File 0001-Fixed-resource-leak-line-2023-nameCopy-not-freed.patch, 851 bytes (added by Ceann, 6 years ago)
  • src/kits/media/ParameterWeb.cpp

    From de58c06813dd29f3a00bbc7848a7f598cf6e93ec Mon Sep 17 00:00:00 2001
    From: Cormac O'Brien <i.am.cormac.obrien@gmail.com>
    Date: Thu, 21 Nov 2013 20:52:19 +0000
    Subject: [PATCH] Fixed resource leak @ line 2023 -- nameCopy not freed
    
    ---
     src/kits/media/ParameterWeb.cpp |    4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/src/kits/media/ParameterWeb.cpp b/src/kits/media/ParameterWeb.cpp
    index 76adc08..9226b72 100644
    a b BDiscreteParameter::AddItem(int32 value, const char* name)  
    20232023        return B_NO_MEMORY;
    20242024    }
    20252025
    2026     if (!fValues->AddItem(valueCopy) || !fSelections->AddItem(nameCopy))
     2026    if (!fValues->AddItem(valueCopy) || !fSelections->AddItem(nameCopy)) {
     2027        free(nameCopy);
    20272028        return B_NO_MEMORY;
     2029    }
    20282030
    20292031    return B_OK;
    20302032}