From: Daniel Stenberg Date: Thu, 13 Apr 2023 07:36:57 +0000 (+0200) Subject: rtsp: skip NULL assigns after Curl_safefree() X-Git-Tag: curl-8_1_0~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa3ee0a13ae4ba532e07911bf5cc58d591b16808;p=thirdparty%2Fcurl.git rtsp: skip NULL assigns after Curl_safefree() ... since this is a macro that assigns NULL itself. Pointed out by PVS. Ref: #10929 Closes #10946 --- diff --git a/lib/rtsp.c b/lib/rtsp.c index 3eebd5ace2..ea99d720ec 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -376,7 +376,6 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) if(Curl_checkheaders(data, STRCONST("User-Agent")) && data->state.aptr.uagent) { Curl_safefree(data->state.aptr.uagent); - data->state.aptr.uagent = NULL; } else if(!Curl_checkheaders(data, STRCONST("User-Agent")) && data->set.str[STRING_USERAGENT]) { @@ -396,8 +395,6 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) Curl_safefree(data->state.aptr.ref); if(data->state.referer && !Curl_checkheaders(data, STRCONST("Referer"))) data->state.aptr.ref = aprintf("Referer: %s\r\n", data->state.referer); - else - data->state.aptr.ref = NULL; p_referrer = data->state.aptr.ref; @@ -478,7 +475,6 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) * with basic and digest, it will be freed anyway by the next request */ Curl_safefree(data->state.aptr.userpwd); - data->state.aptr.userpwd = NULL; if(result) return result;