handle malloc returning null