Open yangfar opened 1 year ago
Also found by cppcheck:
src/shc.c(1033): error (memleak): Memory leak: ptr
src/shc.c(1088): error (memleak): Memory leak: text
src/shc.c(1037): error (memleakOnRealloc): Common realloc mistake: 'shll' nulled but not freed upon failure
src/shc.c(1065): error (memleakOnRealloc): Common realloc mistake: 'opts' nulled but not freed upon failure
src/shc.c(1090): error (memleakOnRealloc): Common realloc mistake: 'text' nulled but not freed upon failure
src/shc.c(1099): error (memleakOnRealloc): Common realloc mistake: 'text' nulled but not freed upon failure
When I compiled shc in afl-gcc and fsanitize mode and converted sh to an executable file, I found a memory leak. https://github.com/kn007/silk-v3-decoder/commit/07bfa0f56bbfcdacd56e2e73b7bcd10a0efb7f4c
Details: fl-clang-fast 2.57b by lszekeres@google.com afl-llvm-pass 2.57b by lszekeres@google.com [+] Instrumented 82 locations (ASAN/MSAN mode, ratio 100%).
================================================================= ==61537==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 65 byte(s) in 1 object(s) allocated from:
0 0x493e59 in realloc (/home/yzy/fuzzsoftware/shc/local/bin/shc+0x493e59)
Direct leak of 44 byte(s) in 1 object(s) allocated from:
0 0x493e59 in realloc (/home/yzy/fuzzsoftware/shc/local/bin/shc+0x493e59)
Cmd: ./shc -f /home/root/shc/converter.sh -o converter Ubuntu: x86_64 x86_64 x86_64 GNU/Linux
Thanks!