Don't test for NULL before calling free(3)

free(3) accepts NULL, since the oldest ISO C.  I guess the
paranoid code was taking care of prehistoric implementations of
free(3).  I've never known of an implementation that doesn't
conform to this, so let's simplify this.

Remove xfree(3), which was effectively an equivalent of free(3).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alex Colomar
2022-09-28 22:03:52 +02:00
committed by Iker Pedrosa
parent 1b0e189e35
commit 0d9799de04
11 changed files with 18 additions and 58 deletions

View File

@ -388,10 +388,7 @@ int putdef_str (const char *name, const char *value)
return -1;
}
if (NULL != d->value) {
free (d->value);
}
free (d->value);
d->value = cp;
return 0;
}