net.c: Move variable into correct block

It was possible to jump to skip_handler with added_block uninitialized.
(Found by valgrind.)
This commit is contained in:
Jon Shallow authored and mrdeep1 committed 2022-08-08 10:15:15 +01:00
1 parent 58a8b33804
commit b8f01cef06
1 file changed
+1 -1
+1 -1
View File
@@ -2598,6 +2598,7 @@ handle_request(coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu
coap_string_t *query = NULL;
coap_opt_t *observe = NULL;
coap_string_t *uri_path = NULL;
int added_block = 0;
#ifndef WITHOUT_ASYNC
coap_bin_const_t tokenc = { pdu->token_length, pdu->token };
coap_async_t *async;
@@ -2851,7 +2852,6 @@ handle_request(coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu
if (coap_add_token(response, pdu->token_length, pdu->token)) {
int observe_action = COAP_OBSERVE_CANCEL;
coap_block_b_t block;
int added_block = 0;
query = coap_get_query(pdu);
/* check for Observe option RFC7641 and RFC8132 */