diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 16:52:06 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 16:52:06 +0000 |
commit | cd5294dfb46df5e381a9cdc7672f60713e776301 (patch) | |
tree | e78d7dd9595c7f26b0ded69a8feb833a3e9b9d1d | |
parent | 88b83be07b0c080a460db393d292c9a0b3c05c39 (diff) | |
download | rtmux-cd5294dfb46df5e381a9cdc7672f60713e776301.tar.gz rtmux-cd5294dfb46df5e381a9cdc7672f60713e776301.tar.bz2 rtmux-cd5294dfb46df5e381a9cdc7672f60713e776301.zip |
Sync OpenBSD patchset 221:
Clear the codes array earlier as tty_term_free could be called on error.
-rw-r--r-- | tty-term.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty-term.c,v 1.27 2009-08-09 15:57:13 tcunha Exp $ */ +/* $Id: tty-term.c,v 1.28 2009-08-09 16:52:06 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -244,6 +244,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. */ @@ -266,7 +267,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]; |