mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'contrib/github_pr_13945' into 'master'
fix(esp_http_client): Do not allocate client->if_name twice in esp_http_client_init. (GitHub PR) Closes IDFGH-12994 See merge request espressif/esp-idf!31497
This commit is contained in:
commit
f0781c4641
@ -662,9 +662,11 @@ static bool init_common_tcp_transport(esp_http_client_handle_t client, const esp
|
||||
}
|
||||
|
||||
if (config->if_name) {
|
||||
if (client->if_name == NULL) {
|
||||
client->if_name = calloc(1, sizeof(struct ifreq));
|
||||
ESP_RETURN_ON_FALSE(client->if_name, false, TAG, "Memory exhausted");
|
||||
memcpy(client->if_name, config->if_name, sizeof(struct ifreq));
|
||||
}
|
||||
esp_transport_tcp_set_interface_name(transport, client->if_name);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user