The value of the pointer av changes before it is freed.
Introduce a new variable, lav, to track the original value.
Use clang's static analyzer, scan-build, to find the problem and later to show resolution.
Looks good to me. There's just one minor nit, though; in get_mac_addr_mask()::ipfw2.c
there's already precedence for using 'o' rather than 'l' (as in "local"?) as prefix for the
variable holding the original pointer returned by strdup(3). It would be great to stay
consistent across ipfw(8) in this regard.
If I'm not mistaken, you don't have a src commit bit. Shall I commit the change on
behalf of you?
No commit bit.
Yes, l as in local, there have been similar problems where the pointer
variable is a passed in parameter.
Let me do the o change first, I¹ll take take of that tomorrow.