Browse Source

Don't toss out the buffer in read_socket_line if we just timed out

master
Con Kolivas 11 years ago
parent
commit
a25dc8ab50
  1. 2
      src/ckpool.c

2
src/ckpool.c

@ -192,7 +192,7 @@ int read_socket_line(connsock_t *cs, int timeout)
cs->buflen = cs->bufofs = 0; cs->buflen = cs->bufofs = 0;
*eom = '\0'; *eom = '\0';
out: out:
if (ret < 1) { if (ret < 0) {
dealloc(cs->buf); dealloc(cs->buf);
if (ret < 0 && cs->fd > 0) { if (ret < 0 && cs->fd > 0) {
close(cs->fd); close(cs->fd);

Loading…
Cancel
Save