diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 11:46:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 11:46:30 +0000 |
commit | a529867715c34e402341b54ddaded04afc322762 (patch) | |
tree | d6a35adffd787a516411bf62571ff0c4c0c2ab95 /usr.bin/tmux/server-fn.c | |
parent | a53009dc25919bd21139e0f479525a0ce452aadc (diff) |
Grouped sessions were being leaked on destroy, correctly free them.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r-- | usr.bin/tmux/server-fn.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 17d41bcedf6..9b88f64830b 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.70 2013/07/05 14:52:33 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.71 2013/10/10 11:46:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -398,14 +398,15 @@ void server_destroy_session_group(struct session *s) { struct session_group *sg; + struct session *s1; if ((sg = session_group_find(s)) == NULL) server_destroy_session(s); else { - TAILQ_FOREACH(s, &sg->sessions, gentry) + TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) { server_destroy_session(s); - TAILQ_REMOVE(&session_groups, sg, entry); - free(sg); + session_destroy(s); + } } } |