X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fnfs%2Fxmalloc.c;fp=support%2Fnfs%2Fxmalloc.c;h=0000000000000000000000000000000000000000;hb=4e2bae795e5eaf9922f0b966ab5df64994c836a2;hp=e9fd7c7b3a143715866b47be6d6dde83904373ca;hpb=a0520fa1a41bd33815b331b660b4545f2723495c;p=nfs-utils.git diff --git a/support/nfs/xmalloc.c b/support/nfs/xmalloc.c deleted file mode 100644 index e9fd7c7..0000000 --- a/support/nfs/xmalloc.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * support/nfs/xmalloc.c - * - * malloc with NULL checking. - * - * Copyright (C) 1995, 1996 Olaf Kirch - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include "xmalloc.h" -#include "xlog.h" - -void * -xmalloc(size_t size) -{ - void *ptr; - - if (!(ptr = malloc(size))) - xlog(L_FATAL, "malloc: out of memory"); - return ptr; -} - -void * -xrealloc(void *ptr, size_t size) -{ - if (!(ptr = realloc(ptr, size))) - xlog(L_FATAL, "realloc: out of memory"); - return ptr; -} - -void -xfree(void *ptr) -{ - free(ptr); -} - -char * -xstrdup(const char *str) -{ - char *ret; - - if (!(ret = strdup(str))) - xlog(L_FATAL, "strdup: out of memory"); - return ret; -}