urlapi: use more Curl_safefree

Closes #5968
This commit is contained in:
Emil Engler 2020-09-16 21:33:27 +02:00 committed by Daniel Stenberg
parent 1060955a61
commit c0f0e400e0
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 2 additions and 4 deletions

View 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;