free memory allocated by malloc when cache rewinded