Fix windows crash as of useing wrong free function

Fix windows crash as of useing wrong free function