Skip to content
Commit e018281d authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: lib: dns: Fix DNS dispatcher double net buf unref



The `dns_data` buffer, allocated by the DNS dispatcher was dereferenced
twice - once in registered DNS handler, second time in the dispatcher
itself.

Since the buffer was allocated by the dispatcher, and it's not really
guaranteed that the buffer will be freed in the registered handler (this
depends on the processing outcome, the function may return early w/o
freeing the net buf in case of errors), it makes most sense for the
dispatcher to keep ownership of the buffer. Hence, the registered
handlers will no longer release the buffer provided in any case, and the
dispatcher will free it on exit.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent fe382e57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment