From 44762971c234f0b23a07c76e174aca7bcc117910 Mon Sep 17 00:00:00 2001 From: Han Xinrong Date: Tue, 8 Dec 2020 11:29:44 +0800 Subject: [PATCH] sys/net/application_layer/cord: add error check to cord_ep_register() --- sys/net/application_layer/cord/ep/cord_ep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/application_layer/cord/ep/cord_ep.c b/sys/net/application_layer/cord/ep/cord_ep.c index bd60b4c4d0..943938bf67 100644 --- a/sys/net/application_layer/cord/ep/cord_ep.c +++ b/sys/net/application_layer/cord/ep/cord_ep.c @@ -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);