The main point of freez is to prevent double frees
and to let Privoxy crash sooner if freed memory is
accessed (thus making debugging easier).
In this case, the memset() already takes care of that.
free(0) is supposed to be nop and the NULL check currently
done by freez is a micro "optimization" which is probably
pointless on all platforms Privoxy runs on.
While I replaced some free()s with freez() in the past,
I didn't intend to change most of them and probably
didn't (there seem to be 164 free() occurrences left).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't see the point, the pointer is already cleared by
the memset() in the next line, together with the rest of
the struct members.
On 7/23/16, Fabian Keil fabiankeil@users.sf.net wrote:
I thought point of freez was making sure you don't do a free(0)
That and consistency; didn't you change most of the "free(xxx)" calls
to "freez(xxx)"?
Lee
Related
Patches:
#137The main point of freez is to prevent double frees
and to let Privoxy crash sooner if freed memory is
accessed (thus making debugging easier).
In this case, the memset() already takes care of that.
free(0) is supposed to be nop and the NULL check currently
done by freez is a micro "optimization" which is probably
pointless on all platforms Privoxy runs on.
While I replaced some free()s with freez() in the past,
I didn't intend to change most of them and probably
didn't (there seem to be 164 free() occurrences left).
closed - wontfix
free(0) just returns instead of crashing so there's no reason to change this free to freez