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 authored and Jon Shallow committed 2025-06-12 13:55:53 +01:00
1 parent 06ff7e092b
commit 17c3feeb08
1 file changed
+3
+3
View File
@@ -543,6 +543,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);
}