mirror of https://github.com/ARMmbed/mbed-os.git
Call "new" instead of no-throw version and the MBED_ERROR.
Standard new operator already calls MBED_ERROR in failure.pull/9424/head
parent
86019af7eb
commit
06aea98f99
|
@ -105,11 +105,7 @@ static void call_all_event_listeners(NetworkInterface *iface, nsapi_event_t even
|
||||||
void NetworkInterface::add_event_listener(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb)
|
void NetworkInterface::add_event_listener(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb)
|
||||||
{
|
{
|
||||||
iface_eventlist_t *event_list = get_interface_event_list_head();
|
iface_eventlist_t *event_list = get_interface_event_list_head();
|
||||||
iface_eventlist_entry_t *entry = new (std::nothrow) iface_eventlist_entry_t;
|
iface_eventlist_entry_t *entry = new iface_eventlist_entry_t;
|
||||||
if (!entry) {
|
|
||||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_NETWORK_STACK, MBED_ERROR_CODE_ENOMEM), "Failed to allocate entry");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
entry->iface = this;
|
entry->iface = this;
|
||||||
entry->status_cb = status_cb;
|
entry->status_cb = status_cb;
|
||||||
ns_list_add_to_end(event_list, entry);
|
ns_list_add_to_end(event_list, entry);
|
||||||
|
|
Loading…
Reference in New Issue