Re: [PATCH] Fix memory function use
* Brendan Cully [06-05-02 13:25:30 -0700] wrote:
I never got the point of FREE vs safe_free - I don't see it as a bug
to use safe_free, though it is an inconsistency.
If I recall correctly, some years ago there was:
#define FREE(X) safe_free((void**)(X))
just to avoid having to write all the casts manually.
Now it's even more dangerous since safe_free() dereferences its
pointers without a big fat warning somewhere. In fact, before adding the
check_sec.sh checks I though about just adding a note somewhere but
couldn't really find an accurate place for it...
Now for "core" mutt this isn't interesting IMHO, just for people who
I've removed the PATCHES/check_sec.sh changes and saved it as 'p1' in
that directory which only replaces safe_free() by FREE().
Personally, I'd rather take to the time to double-check the use and keep
the check_sec.sh part since the first chunk in muttlib.c really looks
like a bug which could have been found that way. (and check_sec.sh would
only complain if there's no ampersand before the operator to FREE() so
not all FREE() calls are affected)