http body: use HTPCalloc

pull/1886/merge
Victor Julien 11 years ago
parent 77f67062de
commit 8631b73852

@ -85,16 +85,14 @@ int HtpBodyAppendChunk(HtpTxUserData *htud, HtpBody *body, uint8_t *data, uint32
if (body->first == NULL) { if (body->first == NULL) {
/* New chunk */ /* New chunk */
bd = (HtpBodyChunk *)HTPMalloc(sizeof(HtpBodyChunk)); bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk));
if (bd == NULL) if (bd == NULL)
goto error; goto error;
bd->len = len; bd->len = len;
bd->stream_offset = 0; bd->stream_offset = 0;
bd->next = NULL;
bd->logged = 0;
bd->data = HTPMalloc(len); bd->data = HTPCalloc(1, len);
if (bd->data == NULL) { if (bd->data == NULL) {
goto error; goto error;
} }
@ -104,16 +102,14 @@ int HtpBodyAppendChunk(HtpTxUserData *htud, HtpBody *body, uint8_t *data, uint32
body->content_len_so_far = len; body->content_len_so_far = len;
} else { } else {
bd = (HtpBodyChunk *)HTPMalloc(sizeof(HtpBodyChunk)); bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk));
if (bd == NULL) if (bd == NULL)
goto error; goto error;
bd->len = len; bd->len = len;
bd->stream_offset = body->content_len_so_far; bd->stream_offset = body->content_len_so_far;
bd->next = NULL;
bd->logged = 0;
bd->data = HTPMalloc(len); bd->data = HTPCalloc(1, len);
if (bd->data == NULL) { if (bd->data == NULL) {
goto error; goto error;
} }

Loading…
Cancel
Save