mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-22 15:25:14 +03:00
coap_session.c: additional NULL pointer check
Coverity scan CID 1458386 has detected a potential NULL pointer being dereferenced in coap_session_free().
This commit is contained in:
1 parent
6fb2e671d1
commit
9bf7032232
1 file changed
+1
-1
+1
-1
@@ -122,7 +122,7 @@ void coap_session_free(coap_session_t *session) {
|
||||
coap_free(session->psk_key);
|
||||
|
||||
LL_FOREACH_SAFE(session->sendqueue, q, tmp) {
|
||||
if (q->pdu->type==COAP_MESSAGE_CON && session->context->nack_handler)
|
||||
if (q->pdu->type==COAP_MESSAGE_CON && session->context && session->context->nack_handler)
|
||||
session->context->nack_handler(session->context, session, q->pdu, session->proto == COAP_PROTO_DTLS ? COAP_NACK_TLS_FAILED : COAP_NACK_NOT_DELIVERABLE, q->id);
|
||||
coap_delete_node(q);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user