flash: avoid checking for non NULL pointer to free it