http-parser.c

Small C library to parse HTTP requests
Log | Files | Refs | README | LICENSE

commit 84339d984e71705d70e55a3e77a704cff5f45e3b
parent 2ad2f7493c3aaaeee35f4850fe166e2c3d570fb8
Author: finwo <finwo@pm.me>
Date:   Fri,  4 Aug 2023 21:29:20 +0200

Free the buffer contents from http messages

Diffstat:
Msrc/http-parser.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/http-parser.c b/src/http-parser.c @@ -141,7 +141,7 @@ void http_parser_message_free(struct http_parser_message *subject) { if (subject->method ) free(subject->method); if (subject->path ) free(subject->path); if (subject->version) free(subject->version); - if (subject->body ) free(subject->body); + if (subject->body ) { buf_clear(subject->body); free(subject->body); } if (subject->headers) http_parser_header_free(subject->headers); if (subject->buf ) free(subject->buf); free(subject);