Check malloc's return value