resource.c: Use initialized token in coap_notify_observers()

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-04-03 17:27:58 +01:00
1 parent da6459416f
commit 6cd2ecb136
1 file changed
+1 -2
+1 -2
View File
@@ -867,7 +867,6 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r,
coap_deleting_resource_t deleting) {
coap_method_handler_t h;
coap_subscription_t *obs, *otmp;
coap_bin_const_t token;
coap_pdu_t *response;
uint8_t buf[4];
coap_string_t *query;
@@ -979,7 +978,7 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r,
coap_remove_option(response, COAP_OPTION_OBSERVE);
}
if (COAP_RESPONSE_CLASS(response->code) > 2) {
coap_delete_observer(r, obs->session, &token);
coap_delete_observer(r, obs->session, &obs->pdu->actual_token);
obs = NULL;
}
break;