=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-load-buffer.c,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/tmux/cmd-load-buffer.c 2010/07/24 20:11:59 1.13 --- src/usr.bin/tmux/cmd-load-buffer.c 2010/12/20 00:03:55 1.14 *************** *** 1,4 **** ! /* $OpenBSD: cmd-load-buffer.c,v 1.13 2010/07/24 20:11:59 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha --- 1,4 ---- ! /* $OpenBSD: cmd-load-buffer.c,v 1.14 2010/12/20 00:03:55 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha *************** *** 81,86 **** --- 81,87 ---- cdata = xmalloc(sizeof *cdata); cdata->session = s; + cdata->session->references++; cdata->buffer = data->buffer; c->stdin_data = cdata; c->stdin_callback = cmd_load_buffer_callback; *************** *** 144,150 **** char *pdata; size_t psize; u_int limit; - int idx; /* * Event callback has already checked client is not dead and reduced --- 145,150 ---- *************** *** 153,159 **** c->flags |= CLIENT_EXIT; /* Does the target session still exist? */ ! if (session_index(s, &idx) != 0) goto out; psize = EVBUFFER_LENGTH(c->stdin_event->input); --- 153,159 ---- c->flags |= CLIENT_EXIT; /* Does the target session still exist? */ ! if (!session_alive(s)) goto out; psize = EVBUFFER_LENGTH(c->stdin_event->input); *************** *** 180,184 **** --- 180,185 ---- } out: + cdata->session->references--; xfree(cdata); }