I downloaded some thing that purports to be the "Nintendo 64 SDK" and it says that its implementation of malloc cannot be accessed safely by multiple threads (there's an alternative function that does guarantee this). I think this might be it? (FYI: the free function does check for NULL.)