Operation:
In esp_http_client_set_url, we check for if old_host is same as new_host.
Delete and open new connection if host is different.
Issue:
We just pointed client->connection_info.host to old_host and reassigned it.
This made old_host and new_host always point to same location and hence, using old_host with new request.
Fix:
Made a separate copy for old_host using strdup.
Related issue on github: https://github.com/espressif/esp-idf/issues/2631
Related merge request on idf: https://gitlab.espressif.cn:6688/idf/esp-idf/merge_requests/4623/
Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>