mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-21 14:59:06 +03:00
coap-server.c: fix use after free in check_async()
As coap_send() automatically releases the specified pdu, it must not be accessed after coap_send() has returned. This change fixes CID 1458399 reported by Coverity scan.
This commit is contained in:
1 parent
67a9210dbd
commit
29692faa86
1 file changed
+1
-2
@@ -266,8 +266,7 @@ check_async(coap_context_t *ctx,
|
||||
coap_add_data(response, 4, (unsigned char *)"done");
|
||||
|
||||
if (coap_send(async->session, response) == COAP_INVALID_TID) {
|
||||
debug("check_async: cannot send response for message %d\n",
|
||||
response->tid);
|
||||
debug("check_async: cannot send response for message\n");
|
||||
}
|
||||
coap_remove_async(ctx, async->session, async->id, &tmp);
|
||||
coap_free_async(async);
|
||||
|
||||
Reference in new issue
Block a user