Changed malloc to calloc and added appropriate checks to both SENNA_malloc and SENNA_realloc