summaryrefslogtreecommitdiff
path: root/gnu/libexec/uucp/libuucp/xreall.c
blob: 36ae313a508103b8379ad82d0a486f96f55b1689 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* xreall.c
   Realloc a block of memory without fail.  Supposedly some versions of
   realloc can't handle a NULL first argument, so we check for that
   here.  */

#include "uucp.h"

#include "uudefs.h"

pointer
xrealloc (p, c)
     pointer p;
     size_t c;
{
  pointer pret;

  if (p == NULL)
    return xmalloc (c);
  pret = realloc (p, c);
  if (pret == NULL && c != 0)
    ulog (LOG_FATAL, "Out of memory");
  return pret;
}