rtmp: fix double-free on URL parse errors

Reported-by: Stanislav Fort (Aisle Research)
Closes #19438
This commit is contained in:
Daniel Stenberg 2025-11-10 08:11:30 +01:00
parent 79d3e1d7d4
commit 00872d5c98
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -240,10 +240,9 @@ static CURLcode rtmp_setup_connection(struct Curl_easy *data,
RTMP_Init(r);
RTMP_SetBufferMS(r, DEF_BUFTIME);
if(!RTMP_SetupURL(r, data->state.url)) {
RTMP_Free(r);
if(!RTMP_SetupURL(r, data->state.url))
/* rtmp_conn_dtor() performs the cleanup */
return CURLE_URL_MALFORMAT;
}
return CURLE_OK;
}