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 176096 byte(s) in 5503 object(s) allocated from:
    #0 0x7f3a464f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f3a44009219 in Airline::Init::Init() sdrbase/util/airlines.cpp:5559
    f4exb#2 0x7f3a43dc797d in _sub_I_65535_0.0 (build/lib/libsdrbase.so+0x3c797d) (BuildId: fb568b705538a6e506ee23027626f4366b25aa50)
    f4exb#3 0x7f3a46c6ce3d in call_init elf/dl-init.c:74
    f4exb#4 0x7f3a46c6ce3d in call_init elf/dl-init.c:26
  • Loading branch information
dforsi committed May 19, 2024
1 parent 9e3c94a commit 04552db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdrbase/util/airlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5560,3 +5560,8 @@ Airline::Init::Init()
s += 4;
}
}

Airline::Init::~Init()
{
qDeleteAll(m_icaoHash);
}
1 change: 1 addition & 0 deletions sdrbase/util/airlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SDRBASE_API Airline {
friend struct Init;
struct Init {
Init();
~Init();
static const char *m_airlines[];
};
static Init m_init;
Expand Down

0 comments on commit 04552db

Please sign in to comment.