eclipse-wakaama / wakaama

Eclipse Wakaama is a C implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).
BSD 3-Clause "New" or "Revised" License
501 stars 374 forks source link

Registration ID memory leak ? #624

Open fdur opened 3 years ago

fdur commented 3 years ago

Hi, When a registration is made, a registration ID is stored in location Function: prv_handleRegistrationReply This location is not freed in prv_handleDeregistrationReply Memory leak ? Thanks

rettichschnidi commented 2 years ago

Sorry for the late answer.

Without looking at the specific code: You are most likely right. There are many memory leaks.

To simplify finding/verifying such issues, build it like this:

mkdir build-wakaama && cd build-wakaama
cmake ../ -DCMAKE_C_FLAGS="-fsanitize=leak" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=leak" -DCMAKE_BUILD_TYPE=Debug
make

When running any binary, it will show you found memory leaks when it exits.