Skip to content
Commit 0b0fd551 authored by Michael Scott's avatar Michael Scott Committed by Anas Nashif
Browse files

net: lwm2m: fix packet leak in timeout work



When a packet expires after the pending retries we call
lwm2m_release_message() to free up resources.  This includes
cleanup of the pending structure which calls net_pkt_unref on
the pending packet.  This would normally free up the packet
memory.  However, earlier in the pending processing we add a ref
to the packet so that normal send processing doesn't free up
the memory.   This meant we were leaking packet memory every
time we had an expiration due to timeout.

Let's do an unref prior to calling lwm2m_release_message() to
make sure the packet memory is freed correctly.

Signed-off-by: default avatarMichael Scott <michael.scott@linaro.org>
parent c9a80de7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment