]> Pileus Git - ~andy/fetchmail/blob - xmalloc.c
ffae9dd9725eab74fd412a5c07cf7b1343f90b00
[~andy/fetchmail] / xmalloc.c
1 /* Copyright 1993-95 by Carl Harris, Jr.
2  * All rights reserved
3  *
4  * Distribute freely, except: don't remove my name from the source or
5  * documentation (don't take credit for my work), mark your changes (don't
6  * get me blamed for your possible bugs), don't alter or remove this
7  * notice.  May be sold if buildable source is provided to buyer.  No
8  * warrantee of any kind, express or implied, is included with this
9  * software; use at your own risk, responsibility for damages (if any) to
10  * anyone resulting from the use of this software rests entirely with the
11  * user.
12  *
13  * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14  * I'll try to keep a version up to date.  I can be reached as follows:
15  * Carl Harris <ceharris@mal.com>
16  */
17
18 /***********************************************************************
19   module:       xmalloc.c
20   project:      popclient
21   programmer:   Carl Harris, ceharris@mal.com
22   description:  malloc wrapper.
23
24   $Log: xmalloc.c,v $
25   Revision 1.1  1996/06/28 14:50:30  esr
26   Initial revision
27
28   Revision 1.1  1995/08/09 01:33:08  ceharris
29   Version 3.0 beta 2 release.
30   Added
31   -     .poprc functionality
32   -     GNU long options
33   -     multiple servers on the command line.
34   Fixed
35   -     Passwords showing up in ps output.
36
37  ***********************************************************************/
38
39
40 #include <config.h>
41 #include <stdio.h>
42 #include <sys/types.h>
43 #include "popclient.h"
44
45 #if defined(HAVE_VOIDPOINTER)
46 #define XMALLOCTYPE void
47 #else
48 #define XMALLOCTYPE char
49 #endif
50
51 XMALLOCTYPE *
52 xmalloc (n)
53 size_t n;
54 {
55   XMALLOCTYPE *p;
56
57   p = (XMALLOCTYPE *) malloc(n);
58   if (p == (XMALLOCTYPE *) 0) {
59     fputs("malloc failed\n",stderr);
60     exit(PS_UNDEFINED);
61   }
62   return(p);
63 }