summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-05 19:05:03 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-05 19:05:03 +0000
commit53c71b308403f15196b6be24ce376bfc5ee0f262 (patch)
tree16cf0a99caf92c57057ed4ae9c534c9341d4a684
parente19f26e36db15d832209add2dad9b60eabf90a26 (diff)
Clear the codes array earlier as tty_term_free could be called on error.
-rw-r--r--usr.bin/tmux/tty-term.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index 8513d8595aa..195ed55e546 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.6 2009/08/03 15:30:16 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.7 2009/08/05 19:05:02 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -245,6 +245,7 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
term->name = xstrdup(name);
term->references = 1;
term->flags = 0;
+ memset(&term->codes, 0, sizeof term->codes);
SLIST_INSERT_HEAD(&tty_terms, term, entry);
/* Set up curses terminal. */
@@ -267,7 +268,6 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
}
/* Fill in codes. */
- memset(&term->codes, 0, sizeof term->codes);
for (i = 0; i < NTTYCODE; i++) {
ent = &tty_term_codes[i];