diff --git a/examples/client.c b/examples/client.c index bd6f9b5a..f4e499b0 100644 --- a/examples/client.c +++ b/examples/client.c @@ -398,7 +398,7 @@ message_handler(struct coap_context_t *ctx, ((coap_opt_block_num(block_opt) + 1) << 4) | COAP_OPT_BLOCK_SZX(block_opt)), buf); - if (received->hdr->type == COAP_MESSAGE_CON) + if (pdu->hdr->type == COAP_MESSAGE_CON) tid = coap_send_confirmed(ctx, remote, pdu); else tid = coap_send(ctx, remote, pdu); @@ -408,7 +408,7 @@ message_handler(struct coap_context_t *ctx, coap_delete_pdu(pdu); } else { set_timeout(&max_wait, wait_seconds); - if (received->hdr->type != COAP_MESSAGE_CON) + if (pdu->hdr->type != COAP_MESSAGE_CON) coap_delete_pdu(pdu); }