tidy-up: replace Curl_safefree with free before re-assignment

Also drop `NULL` assignments after `Curl_safefree()`.

Closes #16640
This commit is contained in:
Viktor Szakats 2025-03-10 00:31:20 +01:00
parent 9b523773b8
commit 57218d5327
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
15 changed files with 45 additions and 49 deletions

View file

@ -512,10 +512,10 @@ GetFileAndPassword(const char *nextarg, char **file, char **password)
char *certname, *passphrase;
if(nextarg) {
parse_cert_parameter(nextarg, &certname, &passphrase);
Curl_safefree(*file);
free(*file);
*file = certname;
if(passphrase) {
Curl_safefree(*password);
free(*password);
*password = passphrase;
}
}
@ -1503,7 +1503,7 @@ static ParameterError parse_verbose(struct GlobalConfig *global,
switch(global->verbosity) {
case 0:
global->verbosity = 1;
Curl_safefree(global->trace_dump);
free(global->trace_dump);
global->trace_dump = strdup("%");
if(!global->trace_dump)
err = PARAM_NO_MEM;