This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coap: When a client is observing a server, a block is always leaked
When a client starts to observe a server, a struct was allocated to keep some context data. When client asks to be unobserved from the server, or if the client is terminated, this block leaks. With this pathc sol-coap will always call reply_cb when a client is unobserved, as it is done when timeout is reached, so users can free memory. One way to check this bahaviour is running the light-server + light-client sample located in src/samples/flow/oic/ and terminating the client execution. Valgrind tells us this: ==2586== 40 bytes in 1 blocks are definitely lost in loss record 20 of 31 ==2586== at 0x4C28C10: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2586== by 0x54128E1: sol_util_memdup (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x53A133A: _resource_request (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x53A1D7C: sol_oic_client_resource_set_observable (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0xCBAD915: found_resource (in /home/otavio/local/soletta/lib/soletta/modules/flow/oic.so) ==2586== by 0x53A05E1: _iterate_over_resource_reply_payload (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x53A08FE: _find_resource_reply_cb (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x5391032: respond_packet (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x5391413: on_can_read (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x53A41F2: on_socket_read (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x538391E: fd_process (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586== by 0x53839FE: sol_mainloop_impl_iter (in /home/otavio/local/soletta/lib/libsoletta.so.0.0.1) ==2586==
- Loading branch information