Fix windows crash as of useing wrong free function