1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

context_destroy: clean up early fail path

This commit is contained in:
Andy Green 2022-02-21 08:18:47 +00:00
parent 67931757f8
commit 3ed01ab4c9

View file

@ -2100,15 +2100,18 @@ next:
lws_plat_context_late_destroy(context);
#if defined(LWS_WITH_PEER_LIMITS)
for (nu = 0; nu < context->pl_hash_elements; nu++) {
lws_start_foreach_llp(struct lws_peer **, peer,
context->pl_hash_table[nu]) {
struct lws_peer *df = *peer;
*peer = df->next;
lws_free(df);
continue;
} lws_end_foreach_llp(peer, next);
}
if (context->pl_hash_table)
for (nu = 0; nu < context->pl_hash_elements; nu++) {
if (!context->pl_hash_table[nu])
continue;
lws_start_foreach_llp(struct lws_peer **, peer,
context->pl_hash_table[nu]) {
struct lws_peer *df = *peer;
*peer = df->next;
lws_free(df);
continue;
} lws_end_foreach_llp(peer, next);
}
lws_free(context->pl_hash_table);
#endif