danmar / simplecpp

C++ preprocessor
BSD Zero Clause License
209 stars 83 forks source link

memory leak when processing empty/non-existent includes with `simplecpp` CLI #342

Open firewave opened 8 months ago

firewave commented 8 months ago
#include</\\>
#include</\\>
==58215==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 144 byte(s) in 2 object(s) allocated from:
    #0 0x7ff948ae2002 in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete>
    #1 0x56404715371a in simplecpp::load(simplecpp::TokenList const&, std::vector<std::__cxx11::basic_string<>

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7ff948ae2002 in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete>
    #1 0x564047162412 in simplecpp::preprocess(simplecpp::TokenList&, simplecpp::TokenList const&, std::vecto>

SUMMARY: AddressSanitizer: 216 byte(s) leaked in 3 allocation(s).