Add mbuf_append result check

PUBLISHED_FROM=967a7ff3684e548ddbfe92365f7718a99e14d098
This commit is contained in:
ruslanvaliullin 2017-06-07 21:34:44 +03:00 committed by Cesanta Bot
parent 023b55f2e5
commit a2192ae483

View File

@ -11618,7 +11618,7 @@ uint32_t mg_coap_compose(struct mg_coap_message *cm, struct mbuf *io) {
/* saving previous lenght to handle non-empty mbuf */
prev_io_len = io->len;
mbuf_append(io, NULL, packet_size);
if (mbuf_append(io, NULL, packet_size) == 0) return MG_COAP_ERROR;
ptr = io->buf + prev_io_len;
/*