1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

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

View File

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