Remove double free() code. Use FREE(ptr) macro instead