diff --git a/src/transport/multicast/rx.c b/src/transport/multicast/rx.c index 0f1d9a1a6..9fb789045 100644 --- a/src/transport/multicast/rx.c +++ b/src/transport/multicast/rx.c @@ -282,9 +282,13 @@ int8_t _z_multicast_handle_transport_message(_z_transport_multicast_t *ztm, _z_t #else entry->_dbuf_reliable = _z_wbuf_make(Z_FRAG_MAX_SIZE, false); entry->_dbuf_best_effort = _z_wbuf_make(Z_FRAG_MAX_SIZE, false); + + if ((_z_wbuf_capacity(&entry->_dbuf_reliable) != Z_FRAG_MAX_SIZE) || + (_z_wbuf_capacity(&entry->_dbuf_best_effort) != Z_FRAG_MAX_SIZE)) { + _Z_ERROR("Not enough memory to allocate peer defragmentation buffers!"); + } #endif #endif - // Update lease time (set as ms during) entry->_lease = t_msg->_body._join._lease; entry->_next_lease = entry->_lease; diff --git a/src/transport/multicast/transport.c b/src/transport/multicast/transport.c index 0ffaa0bb6..f7c07a61a 100644 --- a/src/transport/multicast/transport.c +++ b/src/transport/multicast/transport.c @@ -76,6 +76,7 @@ int8_t _z_multicast_transport_create(_z_transport_t *zt, _z_link_t *zl, // Clean up the buffers if one of them failed to be allocated if ((_z_wbuf_capacity(&ztm->_wbuf) != mtu) || (_z_zbuf_capacity(&ztm->_zbuf) != Z_BATCH_MULTICAST_SIZE)) { ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY; + _Z_ERROR("Not enough memory to allocate transport tx rx buffers!"); #if Z_FEATURE_MULTI_THREAD == 1 zp_mutex_free(&ztm->_mutex_tx); diff --git a/src/transport/unicast/transport.c b/src/transport/unicast/transport.c index 3dd7b49a4..b919e3339 100644 --- a/src/transport/unicast/transport.c +++ b/src/transport/unicast/transport.c @@ -83,6 +83,7 @@ int8_t _z_unicast_transport_create(_z_transport_t *zt, _z_link_t *zl, _z_transpo if ((_z_wbuf_capacity(&zt->_transport._unicast._wbuf) != wbuf_size) || (_z_zbuf_capacity(&zt->_transport._unicast._zbuf) != zbuf_size)) { ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY; + _Z_ERROR("Not enough memory to allocate transport tx rx buffers!"); #if Z_FEATURE_MULTI_THREAD == 1 zp_mutex_free(&zt->_transport._unicast._mutex_tx); @@ -108,6 +109,7 @@ int8_t _z_unicast_transport_create(_z_transport_t *zt, _z_link_t *zl, _z_transpo (_z_wbuf_capacity(&zt->_transport._unicast._dbuf_best_effort) != Z_IOSLICE_SIZE)) { #endif ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY; + _Z_ERROR("Not enough memory to allocate transport defragmentation buffers!"); _z_wbuf_clear(&zt->_transport._unicast._dbuf_reliable); _z_wbuf_clear(&zt->_transport._unicast._dbuf_best_effort);