]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rtsp: skip NULL assigns after Curl_safefree()
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Apr 2023 07:36:57 +0000 (09:36 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Apr 2023 15:14:03 +0000 (17:14 +0200)
... since this is a macro that assigns NULL itself. Pointed out by PVS.

Ref: #10929
Closes #10946

lib/rtsp.c

index 3eebd5ace272639faf5e5f6df5f64650253828a4..ea99d720ec4eb147895856d96563430832399de3 100644 (file)
@@ -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;