efl net server udp - report erro on alloc failure

unwind nicely and complain
This commit is contained in:
Carsten Haitzler 2017-07-24 17:44:22 +09:00
parent 143709faba
commit fd9e6b305d
1 changed files with 9 additions and 0 deletions

View File

@ -340,6 +340,15 @@ _efl_net_server_udp_efl_net_server_fd_process_incoming_data(Eo *o, Efl_Net_Serve
{
void *tmp = realloc(buf, r);
if (tmp) buf = tmp;
else
{
Eina_Error err = efl_net_socket_error_get();
free(buf);
ERR("Out of memory on efl net udp data incoming");
efl_event_callback_call(o, EFL_NET_SERVER_EVENT_ERROR, &err);
return;
}
}
slice = (Eina_Rw_Slice){.mem = buf, .len = r };