1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/application_layer/cord: add error check to cord_ep_register()

This commit is contained in:
Han Xinrong 2020-12-08 11:29:44 +08:00
parent f74cb053b2
commit 44762971c2

View File

@ -276,7 +276,11 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif)
/* set some packet options and write query string */
coap_hdr_set_type(pkt.hdr, COAP_TYPE_CON);
coap_opt_add_uint(&pkt, COAP_OPT_CONTENT_FORMAT, COAP_FORMAT_LINK);
cord_common_add_qstring(&pkt);
res = cord_common_add_qstring(&pkt);
if (res < 0) {
retval = CORD_EP_ERR;
goto end;
}
pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_PAYLOAD);