+
+void *
+xrealloc(void *old, size_t size)
+{
+ /* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */
+ void *x = realloc(old, size);
+ if (!x && size)
+ die("Cannot reallocate %zu bytes of memory", size);
+ return x;
+}