From c0f0e400e0bc43cbe8c42c6937ed0ac743a8d81a Mon Sep 17 00:00:00 2001 From: Emil Engler Date: Wed, 16 Sep 2020 21:33:27 +0200 Subject: [PATCH] urlapi: use more Curl_safefree Closes #5968 --- lib/urlapi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/urlapi.c b/lib/urlapi.c index acbfb82875..88b7f042f4 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -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; -- 2.47.3