summaryrefslogtreecommitdiffstats
path: root/tty-term.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-05 19:05:02 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-05 19:05:02 +0000
commit4027335fa9dd6f6bdce9191695a39529581bfe2a (patch)
tree89b987c5a9254d5635175e84037415d16a3421ae /tty-term.c
parentbcddddf98d46bb9aef919d8e93b7328a7b040140 (diff)
Clear the codes array earlier as tty_term_free could be called on error.
Diffstat (limited to 'tty-term.c')
-rw-r--r--tty-term.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tty-term.c b/tty-term.c
index c96bdb12..37826dab 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -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];