How to mock free function?