[cvs] bogofilter/src xmalloc.c,1.2,1.2.56.1
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-08-07 20:06:28
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1:/tmp/cvs-serv25740 Modified Files: Tag: DatastoreAPI xmalloc.c Log Message: Use name 'ptr' for storage being malloced/freed and clean-up whitespace. Index: xmalloc.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/xmalloc.c,v retrieving revision 1.2 retrieving revision 1.2.56.1 diff -u -d -r1.2 -r1.2.56.1 --- xmalloc.c 8 May 2003 12:31:32 -0000 1.2 +++ xmalloc.c 7 Aug 2003 20:06:23 -0000 1.2.56.1 @@ -20,18 +20,19 @@ void * xmalloc(size_t size){ - void *x; - x = malloc(size); - if (x == NULL && size == 0) - x = malloc(1); - if (x == NULL) { - xmem_error("xmalloc"); - } - return x; + void *ptr; + ptr = malloc(size); + if (ptr == NULL && size == 0) + ptr = malloc(1); + if (ptr == NULL) { + xmem_error("xmalloc"); + } + return ptr; } void xfree(void *ptr){ - if (ptr) free(ptr); + if (ptr) + free(ptr); } |