If they're compiled to a single binary, that should be fine. You're explicitly calling C's malloc, so the corresponding free is correct.
However, if this crosses shared libraries, like the rust code in a DLL and then a main binary, it may be trouble. I think Windows can potentially resolve each to a distinct C runtime, and then the malloc and free wouldn't match.