Correct error message in FREE().

`FREE()` checks for a `NULL` pointer, but generally httpdirfs does not
`NULL` out pointers it attempts to `FREE()` (or `free()`).  As such, the
error message is misleading; make it less so in a trivial way.

Possibly a better, more invasive, change would be for `FREE()` to take a
`void** pp`, check that `*p != NULL`, `free(*p)`, and then `*p = NULL;`.
Were that done, then there would be some plausibility to the current
diagnostic message.
This commit is contained in:
Nathaniel Wesley Filardo 2022-11-01 01:55:43 +00:00
parent 61d3ae4166
commit 833cbf9d67
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ void FREE(void *ptr)
if (ptr) {
free(ptr);
} else {
lprintf(fatal, "attempted to double free a pointer!\n");
lprintf(fatal, "attempted to free NULL ptr!\n");
}
}