There is no sense to checking before calling free() - it's specified (in ANSI C 89) to be a no-op when passed NULL.