Closed liyansong2018 closed 9 months ago
Memory leaks occur when new memory is allocated dynamically and never deallocated. delete seems to have been forgotten, such as
delete
PoC & Log
$ ./diec diec ELF64 Operation system: Unix(-)[DYN AMD64-64] Library: GLIBC(2.34)[DYN AMD64-64] Library: Qt(5.X)[DYN AMD64-64] Compiler: gcc(3.X)[DYN AMD64-64] ================================================================= ==3475313==ERROR: LeakSanitizer: detected memory leaks Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7fb03baf90f8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x564651cb0b21 in DiE_Script::process(QIODevice*, QString const&, DiE_Script::SCAN_RESULT*, long long, long long, XBinary::SCANID, DiE_Script::OPTIONS*, bool, XBinary::PDSTRUCT*) /home/kali/Tools/DIE-engine/die_script/die_script.cpp:595 #2 0x564651ccdd22 in DiE_Script::processDevice(QIODevice*, DiE_Script::OPTIONS*, QString const&, XBinary::PDSTRUCT*) /home/kali/Tools/DIE-engine/die_script/die_script.cpp:578 #3 0x564651cced98 in DiE_Script::processFile(QString const&, DiE_Script::OPTIONS*, QString const&, XBinary::PDSTRUCT*) /home/kali/Tools/DIE-engine/die_script/die_script.cpp:563 Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7fb03baf90f8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fb03b9157ad (/lib/x86_64-linux-gnu/libQt5Script.so.5+0x1747ad) (BuildId: 6db15c9f156144fdc445302716fb297c711fa3f5) Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7fb03baf90f8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x7fb03b915d56 (/lib/x86_64-linux-gnu/libQt5Script.so.5+0x174d56) (BuildId: 6db15c9f156144fdc445302716fb297c711fa3f5) SUMMARY: AddressSanitizer: 32 byte(s) leaked in 3 allocation(s).
Memory leaks occur when new memory is allocated dynamically and never deallocated.
delete
seems to have been forgotten, such asPoC & Log