]> mj.ucw.cz Git - osdd.git/blobdiff - util.c
util.c: Added xrealloc()
[osdd.git] / util.c
diff --git a/util.c b/util.c
index f9cd0c2bc59a3da2502c1ca510e112c3d4fbaf54..911e18bb764cd973b76a27867a8934959c7560a3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -31,6 +31,15 @@ xmalloc(int size)
   return p;
 }
 
+void *
+xrealloc(void *ptr, int size)
+{
+  void *p = realloc(ptr, size);
+  if (!p)
+    die("Failed to re-allocate %d bytes of memory", size);
+  return p;
+}
+
 timestamp_t
 get_current_time(void)
 {