New function: xmalloc_and_zero, which initialises the allocated memory