1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

websocket: check return value of list_destroy() calls

This commit is contained in:
Steffen Vogel 2018-05-26 01:15:23 +02:00
parent 8819c4101f
commit 18a1daede8

View file

@ -352,6 +352,8 @@ int websocket_init(struct super_node *sn)
int websocket_deinit()
{
int ret;
for (size_t i = 0; i < list_length(&connections); i++) {
struct websocket_connection *c = (struct websocket_connection *) list_at(&connections, i);
@ -366,7 +368,9 @@ int websocket_deinit()
sleep(1);
}
list_destroy(&connections, (dtor_cb_t) websocket_destination_destroy, true);
ret = list_destroy(&connections, (dtor_cb_t) websocket_destination_destroy, true);
if (ret)
return ret;
return 0;
}
@ -470,8 +474,11 @@ int websocket_stop(struct node *n)
int websocket_destroy(struct node *n)
{
struct websocket *w = (struct websocket *) n->_vd;
int ret;
list_destroy(&w->destinations, (dtor_cb_t) websocket_destination_destroy, true);
ret = list_destroy(&w->destinations, (dtor_cb_t) websocket_destination_destroy, true);
if (ret)
return ret;
return 0;
}