coap_session_mfree: Check for lg_crcv all cleared out if failure

Call to coap_cancel_observe_lkd() may cause session->lg_crcv to be cleared
out if transmission failure.
This commit is contained in:
Jon Shallow committed 2025-09-16 11:41:41 +01:00
1 parent bcf7d62342
commit 33ad2707ab
1 file changed
+3
+3
View File
@@ -509,6 +509,9 @@ coap_session_mfree(coap_session_t *session) {
}
}
}
/* In case coap_cancel_observe_lkd() failure, which could clear down lg_crcv */
if (!session->lg_crcv)
break;
LL_DELETE(session->lg_crcv, lg_crcv);
coap_block_delete_lg_crcv(session, lg_crcv);
}