Success of memory allocation needs to be checked.