*.[ch] refactoring: make use of the FREE_AND_NULL() macro