mirror of
https://github.com/espressif/esp-protocols.git
synced 2026-07-06 00:20:49 +02:00
fix(websocket): fix use-after-free race condition in task stop sequence
This commit is contained in:
@@ -1374,10 +1374,11 @@ static void esp_websocket_client_task(void *pv)
|
||||
|
||||
esp_websocket_client_dispatch_event(client, WEBSOCKET_EVENT_FINISH, NULL, 0);
|
||||
esp_transport_close(client->transport);
|
||||
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
|
||||
client->state = WEBSOCKET_STATE_UNKNOW;
|
||||
if (client->selected_for_destroying == true) {
|
||||
destroy_and_free_resources(client);
|
||||
} else {
|
||||
xEventGroupSetBits(client->status_bits, STOPPED_BIT);
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user