fix: missed check of malloc.

Hi benhoyt,

I've seen this while reading the code.

regards,

Greg.