/[imapfilter]/imapfilter/memory.c
ViewVC logotype

Diff of /imapfilter/memory.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by lefcha, Thu Oct 4 15:45:53 2001 UTC revision 1.3 by lefcha, Tue Nov 6 17:42:34 2001 UTC
# Line 5  Line 5 
5  #include "imapfilter.h"  #include "imapfilter.h"
6    
7  /*  /*
8   * A malloc that checks the results and dies in case of error.   * A malloc() that checks the results and dies in case of error.
9   */   */
10  void *xmalloc(size_t size)  void *xmalloc(size_t size)
11  {  {
# Line 22  void *xmalloc(size_t size) Line 22  void *xmalloc(size_t size)
22    
23    
24  /*  /*
25   * A strdup that checks the results and dies in case of error.   * A realloc() that checks the results and dies in case of error.
26     */
27    void *xrealloc(void *ptr, size_t size)
28    {
29        ptr = (void *) realloc(ptr, size);
30    
31        if (!ptr)
32            fatal(ERROR_MEMORY_ALLOCATION,
33                  "imapfilter: allocating memory; %s\n", strerror(errno));
34    
35        return ptr;
36    }
37    
38    
39    /*
40     * A strdup() that checks the results and dies in case of error.
41   */   */
42  char *xstrdup(const char *s)  char *xstrdup(const char *s)
43  {  {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26