Ticket #13118: 0041-DirMenu.cpp-fix-memory-leak.patch

File 0041-DirMenu.cpp-fix-memory-leak.patch, 903 bytes (added by mt, 8 years ago)
  • src/kits/tracker/DirMenu.cpp

    From 0ef50c64fd2aaa21bec240f9490aa6af001762c0 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Tue, 20 Dec 2016 05:49:19 +0900
    Subject: [PATCH 41/41] DirMenu.cpp: fix memory leak.
    
    ---
     src/kits/tracker/DirMenu.cpp | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/src/kits/tracker/DirMenu.cpp b/src/kits/tracker/DirMenu.cpp
    index eb61459..e9eb894 100644
    a b BDirMenu::Populate(const BEntry* startEntry, BWindow* originatingWindow,  
    9595        Model model(startEntry);
    9696        ThrowOnInitCheckError(&model);
    9797
    98         ModelMenuItem* menu = new ModelMenuItem(&model, this, true, true);
     98        ModelMenuItem* menu = NULL;
    9999
    100         if (fMenuBar)
     100        if (fMenuBar) {
     101            menu = new ModelMenuItem(&model, this, true, true);
    101102            fMenuBar->AddItem(menu);
     103        }
    102104
    103105        BEntry entry(*startEntry);
    104106