From 8647a991a417655a5d0e4a0eac24d480b4fc45a3 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 6 Apr 2024 21:00:59 +0200 Subject: [PATCH] Fix memleak found with AddressSanitizer/LeakSanitizer Found with: ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel Fixes: Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7ff2588f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7ff256723dd0 in MainCore::appendFeatureSet() sdrbase/maincore.cpp:190 #2 0x7ff25817fb89 in MainWindow::addFeatureSet() sdrgui/mainwindow.cpp:1191 #3 0x7ff25815a4d0 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:250 #4 0x559632289175 in runQtApplication app/main.cpp:196 #5 0x559632286ab7 in main app/main.cpp:248 #6 0x7ff252e456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 --- sdrbase/maincore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index ac5c74066..dcb11060c 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -209,6 +209,7 @@ void MainCore::removeLastFeatureSet() FeatureSet *featureSet = m_featureSets.back(); m_featureSetsMap.remove(featureSet); m_featureSets.pop_back(); + delete featureSet; } }