We can now counter_u64_free(NULL), so remove the checks.
MFC after: 1 week
Sponsored-by: Rubicon Communications, LLC ("Netgate")
Differential D29190
pf: Simplify cleanup kp on Mar 10 2021, 3:42 PM. Authored by Tags None Referenced Files
Details
We can now counter_u64_free(NULL), so remove the checks. MFC after: 1 week
Diff Detail
Event TimelineComment Actions Can counter ptr really be NULL is these cases? If yes, I'd rather retain the existing checks as they indicate that this a valid possibility. Also, counter(9) man page says nothing about the free(NULL) use case. Comment Actions It can happen, but really only if we fail to allocate memory (see line 520-521).
Until D29189 it couldn't handle that. This commit builds on top of that. Comment Actions Yep :-) What I'm saying is that the man page should also be updated to reflect the code changes. |