Fix malloc() returning null