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:
parent
61d3ae4166
commit
833cbf9d67
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue