Fix some "malloc of 0 bytes" warnings