free memory checking