Skip to content

Commit

Permalink
Fix memleaks found with AddressSanitizer/LeakSanitizer
Browse files Browse the repository at this point in the history
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7f9d7d0f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f9d7af247aa in MainCore::appendDeviceSet(int) sdrbase/maincore.cpp:219
    f4exb#2 0x7f9d7c95c8a5 in MainWindow::sampleSourceAdd(Workspace*, Workspace*, int) sdrgui/mainwindow.cpp:359
    f4exb#3 0x7f9d7c97ce3c in MainWindow::loadConfiguration(Configuration const*, bool) sdrgui/mainwindow.cpp:1439
    f4exb#4 0x7f9d7c95a610 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:261
    f4exb#5 0x562f7c492175 in runQtApplication app/main.cpp:196
    f4exb#6 0x562f7c48fab7 in main app/main.cpp:248
    f4exb#7 0x7f9d776456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

and 34 others that I'm not copying here.
  • Loading branch information
dforsi committed May 19, 2024
1 parent dc02609 commit 69acbf2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sdrbase/maincore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ void MainCore::removeLastDeviceSet()
DeviceSet *deviceSet = m_deviceSets.back();
m_deviceSetsMap.remove(deviceSet);
m_deviceSets.pop_back();
delete deviceSet;
}
}

Expand Down

0 comments on commit 69acbf2

Please sign in to comment.