c42b51ed96
Comment from Zr says this crashes but looks like this was because there was no check if the function failed to allocate to begin with.