From 196e51d294efa984605b575508e681d7c8cd998b Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Tue, 20 Aug 2013 21:31:43 +0100 Subject: [PATCH] replace calloc http/parser.c with quick fit approach. --- src/http/parser/parse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/http/parser/parse.c b/src/http/parser/parse.c index ad12b67..b9e7082 100644 --- a/src/http/parser/parse.c +++ b/src/http/parser/parse.c @@ -57,8 +57,7 @@ httpParserParse(void * _this, Stream st) if (NULL != this->incomplete) { cbufSetData(this->buffer, this->incomplete, this->isize); - free(this->incomplete); - this->incomplete = NULL; + MEM_FREE(this->incomplete); } if (0 > (read = cbufRead(this->buffer, st))) { @@ -84,7 +83,7 @@ httpParserParse(void * _this, Stream st) if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { if (! cbufIsEmpty(this->buffer)) { this->isize = this->buffer->bused; - this->incomplete = malloc(this->isize); + this->incomplete = memMalloc(this->isize); memcpy(this->incomplete, cbufGetData(this->buffer, this->isize), this->isize); @@ -110,7 +109,7 @@ httpParserParse(void * _this, Stream st) if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { if (! cbufIsEmpty(this->buffer)) { this->isize = this->buffer->bused; - this->incomplete = malloc(this->isize); + this->incomplete = memMalloc(this->isize); memcpy(this->incomplete, cbufGetData(this->buffer, this->isize), this->isize);