Replace xmalloc+memset(0) with xcalloc.