From 94d8e1e69c3202ca630092914d707b198bc4f034 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sat, 4 Mar 2017 08:34:59 +0100 Subject: [PATCH] Fixed a memleak in ReadHotkeyConfig() --- common/hotkeys_basic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index c2f775ef77..ef4fa2d82b 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -635,7 +635,8 @@ void ReadHotkeyConfig( const wxString& Appname, struct EDA_HOTKEY_CONFIG* aDescL wxFileName fn( Appname ); fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT ); - wxConfigBase* config = GetNewConfig( fn.GetFullPath() ); + std::unique_ptr config; + config.reset( GetNewConfig( fn.GetFullPath() ) ); if( !config->HasEntry( HOTKEYS_CONFIG_KEY ) ) { @@ -645,7 +646,6 @@ void ReadHotkeyConfig( const wxString& Appname, struct EDA_HOTKEY_CONFIG* aDescL wxString data; config->Read( HOTKEYS_CONFIG_KEY, &data ); - delete config; ParseHotkeyConfig( data, aDescList ); }