tidy-up: use curlx_safefree()

Closes #21700
This commit is contained in:
Viktor Szakats 2026-05-20 20:43:59 +02:00
parent d3b04e5600
commit bcd0497c81
No known key found for this signature in database
19 changed files with 41 additions and 80 deletions

View file

@ -43,10 +43,8 @@
static ParameterError getstr(char **str, const char *val, bool allowblank)
{
if(*str) {
curlx_free(*str);
*str = NULL;
}
if(*str)
curlx_safefree(*str);
DEBUGASSERT(val);
if(!allowblank && !val[0])
return PARAM_BLANK_STRING;
@ -61,10 +59,8 @@ static ParameterError getstr(char **str, const char *val, bool allowblank)
static ParameterError getstrn(char **str, const char *val,
size_t len, bool allowblank)
{
if(*str) {
curlx_free(*str);
*str = NULL;
}
if(*str)
curlx_safefree(*str);
DEBUGASSERT(val);
if(!allowblank && !val[0])
return PARAM_BLANK_STRING;