diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-06-10 23:45:08 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-06-10 23:45:08 +0200 |
commit | 3d15dcdb1cc91c694aa9319b86bb37510d7ed12b (patch) | |
tree | 96c5dda68741dd75b4b5d0037e782d5d89726d93 /lib/xmalloc.c | |
parent | b99d378698641b9821e4b708a90761aeb9bf6cc4 (diff) |
Changes OSPF to generate stub networks for non-primary addresses.
Also does some reorganization in RT LSA announcement.
Diffstat (limited to 'lib/xmalloc.c')
-rw-r--r-- | lib/xmalloc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/xmalloc.c b/lib/xmalloc.c index bc386c83..da2f0941 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -32,4 +32,24 @@ xmalloc(unsigned size) die("Unable to allocate %d bytes of memory", size); } +/** + * xrealloc - realloc with checking + * @ptr: original memory block + * @size: block size + * + * This function is equivalent to realloc() except that in case of + * failure it calls die() to quit the program instead of returning + * a %NULL pointer. + * + * Wherever possible, please use the memory resources instead. + */ +void * +xrealloc(void *ptr, unsigned size) +{ + void *p = realloc(ptr, size); + if (p) + return p; + die("Unable to allocate %d bytes of memory", size); +} + #endif |