Free the client on best effort write(2) short write.
This commit is contained in:
parent
0219f927dd
commit
4c16e14e41
@ -2264,8 +2264,8 @@ int handleHTTPRequest(struct client *c) {
|
||||
printf("HTTP Reply header:\n%s", hdr);
|
||||
|
||||
/* Send header and content. */
|
||||
if (write(c->fd, hdr, hdrlen) == -1 ||
|
||||
write(c->fd, content, clen) == -1)
|
||||
if (write(c->fd, hdr, hdrlen) != hdrlen ||
|
||||
write(c->fd, content, clen) != clen)
|
||||
{
|
||||
free(content);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user