]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi: use more Curl_safefree
authorEmil Engler <me@emilengler.com>
Wed, 16 Sep 2020 19:33:27 +0000 (21:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 17 Sep 2020 07:44:36 +0000 (09:44 +0200)
Closes #5968

lib/urlapi.c

index acbfb82875df25b16f9ac8d48b407824d5bd15b0..88b7f042f43427d275561700b0c53bc776734f67 100644 (file)
@@ -1255,8 +1255,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
       return CURLUE_UNKNOWN_PART;
     }
     if(storep && *storep) {
-      free(*storep);
-      *storep = NULL;
+      Curl_safefree(*storep);
     }
     return CURLUE_OK;
   }
@@ -1284,8 +1283,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
     break;
   case CURLUPART_HOST:
     storep = &u->host;
-    free(u->zoneid);
-    u->zoneid = NULL;
+    Curl_safefree(u->zoneid);
     break;
   case CURLUPART_ZONEID:
     storep = &u->zoneid;