1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Fix memleaks found with AddressSanitizer/LeakSanitizer

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
    #1 0x7f3a44009219 in Airline::Init::Init() sdrbase/util/airlines.cpp:5559
    #2 0x7f3a43dc797d in _sub_I_65535_0.0 (build/lib/libsdrbase.so+0x3c797d) (BuildId: fb568b705538a6e506ee23027626f4366b25aa50)
    #3 0x7f3a46c6ce3d in call_init elf/dl-init.c:74
    #4 0x7f3a46c6ce3d in call_init elf/dl-init.c:26
This commit is contained in:
Daniele Forsi 2024-04-07 13:10:20 +02:00
parent 08c0668dcb
commit f52d371726
2 changed files with 6 additions and 0 deletions

View File

@ -5560,3 +5560,8 @@ Airline::Init::Init()
s += 4; s += 4;
} }
} }
Airline::Init::~Init()
{
qDeleteAll(m_icaoHash);
}

View File

@ -55,6 +55,7 @@ private:
friend struct Init; friend struct Init;
struct Init { struct Init {
Init(); Init();
~Init();
static const char *m_airlines[]; static const char *m_airlines[];
}; };
static Init m_init; static Init m_init;