Fix a use-after-free when cancelling copy mode, or trying to repeat cancel.

ok kettenis
This commit is contained in:
Nicholas Marriott 2010-03-14 23:31:23 +00:00
parent 7bc3f5dd8a
commit 48dd72005e

View File

@ -256,9 +256,8 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
cmd = mode_key_lookup(&data->mdata, key);
switch (cmd) {
case MODEKEYCOPY_CANCEL:
for (; np != 0; np--)
window_pane_reset_mode(wp);
break;
window_pane_reset_mode(wp);
return;
case MODEKEYCOPY_LEFT:
for (; np != 0; np--)
window_copy_cursor_left(wp);
@ -366,6 +365,7 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
if (c != NULL && c->session != NULL) {
window_copy_copy_selection(wp, c);
window_pane_reset_mode(wp);
return;
}
break;
case MODEKEYCOPY_STARTOFLINE: