antirez
Free the client on best effort write(2) short write
This commit is contained in:
parent
b9a1a3e650
commit
24080a22b1
3
net_io.c
3
net_io.c
|
@ -737,7 +737,8 @@ int handleHTTPRequest(struct client *c, char *p) {
|
|||
}
|
||||
|
||||
// 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 a new issue