2
0
mirror of https://github.com/curl/curl.git synced 2025-04-24 16:40:32 +08:00

rtsp: only store first_host once

Suggested-by: Erik Janssen
URL: https://github.com/curl/curl/pull/9870#issuecomment-1309499744
Closes 
This commit is contained in:
Daniel Stenberg 2022-11-10 08:38:01 +01:00
parent f65f445f54
commit b25e4be79f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

@ -270,15 +270,14 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
/* Setup the first_* fields to allow auth details get sent
to this origin */
/* Free to avoid leaking memory on multiple requests */
free(data->state.first_host);
if(!data->state.first_host) {
data->state.first_host = strdup(conn->host.name);
if(!data->state.first_host)
return CURLE_OUT_OF_MEMORY;
data->state.first_host = strdup(conn->host.name);
if(!data->state.first_host)
return CURLE_OUT_OF_MEMORY;
data->state.first_remote_port = conn->remote_port;
data->state.first_remote_protocol = conn->handler->protocol;
data->state.first_remote_port = conn->remote_port;
data->state.first_remote_protocol = conn->handler->protocol;
}
/* Setup the 'p_request' pointer to the proper p_request string
* Since all RTSP requests are included here, there is no need to