diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-08 18:58:37 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-08 18:58:37 +0000 |
commit | 0668e42e8f5ce3d900218233e35de64905026cac (patch) | |
tree | 0a8f5ce953763cf81d78d51d31263712b9d8da1b /src/buffer.c | |
parent | d5253ec5f435b26c50ca4cb649d3f47b800cbbd8 (diff) |
Changed all the mallocs and callocs to use the new safemalloc and
safecalloc.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index 9001372..dfc79d4 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,4 +1,4 @@ -/* $Id: buffer.c,v 1.6 2001-09-07 04:17:03 rjkaes Exp $ +/* $Id: buffer.c,v 1.7 2001-09-08 18:58:37 rjkaes Exp $ * * The buffer used in each connection is a linked list of lines. As the lines * are read in and written out the buffer expands and contracts. Basically, @@ -63,7 +63,7 @@ static struct bufline_s *makenewline(unsigned char *data, size_t length) assert(data != NULL); - if (!(newline = malloc(sizeof(struct bufline_s)))) + if (!(newline = safemalloc(sizeof(struct bufline_s)))) return NULL; newline->string = data; @@ -98,7 +98,7 @@ struct buffer_s *new_buffer(void) { struct buffer_s *buffptr; - if (!(buffptr = malloc(sizeof(struct buffer_s)))) + if (!(buffptr = safemalloc(sizeof(struct buffer_s)))) return NULL; buffptr->head = buffptr->tail = NULL; @@ -198,7 +198,7 @@ ssize_t readbuff(int fd, struct buffer_s *buffptr) bytesin = read(fd, inbuf, MAXBUFFSIZE - buffer_size(buffptr)); if (bytesin > 0) { - if (!(buffer = malloc(bytesin))) { + if (!(buffer = safemalloc(bytesin))) { log_message(LOG_ERR, "Could not allocate memory in 'readbuff'"); return 0; } |