[PATCH] introduce xmalloc and xrealloc