From 2f59442c2651a85fc24c3f4d2e2bfd92f90ee4d0 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 13 Nov 2009 14:47:31 +0000 Subject: Use winlink_remove() to remove old winlinks when synchronizing grouped sessions rather than doing it manually and not adjusted the reference count. Fixes crash seen by Dan Harnett. --- usr.bin/tmux/session.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/tmux/session.c') diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index 4151c0c8f0e..d160182bce1 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.12 2009/11/03 20:29:47 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.13 2009/11/13 14:47:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -589,7 +589,6 @@ session_group_synchronize1(struct session *target, struct session *s) /* Then free the old winlinks list. */ while (!RB_EMPTY(&old_windows)) { wl = RB_ROOT(&old_windows); - RB_REMOVE(winlinks, &old_windows, wl); - xfree(wl); + winlink_remove(&old_windows, wl); } } -- cgit v1.2.3-59-g8ed1b