Free the client on best effort write(2) short write.

This commit is contained in:
antirez 2013-12-15 21:28:29 +01:00
parent 0219f927dd
commit 4c16e14e41

View File

@ -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;