From aa3ee0a13ae4ba532e07911bf5cc58d591b16808 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Apr 2023 09:36:57 +0200 Subject: [PATCH] rtsp: skip NULL assigns after Curl_safefree() ... since this is a macro that assigns NULL itself. Pointed out by PVS. Ref: #10929 Closes #10946 --- lib/rtsp.c | 4 ---- 1 file changed, 4 deletions(-) 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;