memmove(cp, cp + 1, (utcp->nconnections - i - 1) * sizeof *cp);
utcp->nconnections--;
+ buffer_exit(&c->rcvbuf);
buffer_exit(&c->sndbuf);
free(c);
}
}
if(!buffer_init(&c->rcvbuf, DEFAULT_RCVBUFSIZE, DEFAULT_MAXRCVBUFSIZE)) {
+ buffer_exit(&c->sndbuf);
free(c);
return NULL;
}
for(int i = 0; i < utcp->nconnections; i++) {
if(!utcp->connections[i]->reapable)
debug("Warning, freeing unclosed connection %p\n", utcp->connections[i]);
+ buffer_exit(&utcp->connections[i]->rcvbuf);
buffer_exit(&utcp->connections[i]->sndbuf);
free(utcp->connections[i]);
}