Files
libcoap/include
Olaf Bergmann 48dc4538ce resource.[hc], net.c: fix use after free for query string
If a resource is observed, handle_request() passes the ownership
of a Uri-Query to the observer structure for later retrieval. In
this case, the query is not free'd in handle_request. However, if
the observer data structure ("subscription") was not created due
to insufficient memory, the query string must not be deleted as
it is used for the resource handler callback later in
handle_request(). The solution here passes ownership to the
observer only if case coap_add_observer() is successful.

This fixes CID 1483551.
2020-06-19 16:27:51 +02:00
..