Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2015-04-25 20:45:02 +00:00
11 changed files with 114 additions and 106 deletions

View File

@@ -93,7 +93,7 @@ server_client_create(int fd)
RB_INIT(&c->status_old);
c->message_string = NULL;
ARRAY_INIT(&c->message_log);
TAILQ_INIT(&c->message_log);
c->prompt_string = NULL;
c->prompt_buffer = NULL;
@@ -137,8 +137,7 @@ server_client_open(struct client *c, char **cause)
void
server_client_lost(struct client *c)
{
struct message_entry *msg;
u_int i;
struct message_entry *msg, *msg1;
TAILQ_REMOVE(&clients, c, entry);
log_debug("lost client %d", c->ibuf.fd);
@@ -174,11 +173,11 @@ server_client_lost(struct client *c)
free(c->message_string);
if (event_initialized(&c->message_timer))
evtimer_del(&c->message_timer);
for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) {
msg = &ARRAY_ITEM(&c->message_log, i);
TAILQ_FOREACH_SAFE(msg, &c->message_log, entry, msg1) {
free(msg->msg);
TAILQ_REMOVE(&c->message_log, msg, entry);
free(msg);
}
ARRAY_FREE(&c->message_log);
free(c->prompt_string);
free(c->prompt_buffer);