bhttp

shit http/1.0 server
git clone git://bvnf.space/bhttp.git
Log | Files | Refs

commit 21299bac44902afcfb51be538322fa3fe44461b1
parent eb0a89d83605e5297a0c231b5d378f575078d207
Author: aabacchus <ben@bvnf.space>
Date:   Mon,  4 Jul 2022 14:26:04 +0100

free

Diffstat:
Mbhttp.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bhttp.c b/bhttp.c @@ -51,8 +51,10 @@ parse_header(char *b, size_t n) { } pathend = memchr(space + 1, ' ', n - ((space + 1) - b)); - if (pathend == NULL) + if (pathend == NULL) { + free(myhdr); return NULL; + } *pathend = '\0'; myhdr->path = malloc(pathend-space+1); if (myhdr->path == NULL) { @@ -148,6 +150,7 @@ redo_stat: perror("send"); return; } + free(reply); if (h->op != GET) return; /* HEAD ends here. */