Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/esp_websocket_client/esp_websocket_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static esp_err_t esp_websocket_client_set_config(esp_websocket_client_handle_t c
}

if (config->host) {
free(cfg->host);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we free it before assignment? Have you considered the paths that call this function? Perhaps we should be able to restore the old config in case of failure.

cfg->host = strdup(config->host);
ESP_WS_CLIENT_MEM_CHECK(TAG, cfg->host, return ESP_ERR_NO_MEM);
}
Expand Down
Loading