aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-09 15:57:13 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-09 15:57:13 +0000
commit9002e60adf4201c08ecb5ce849b7d3eda89060c8 (patch)
tree445e9b35eebdca5d5c80b24a06682c50d7618d92
parentbd2fe4ce9b7c723ab2c55b98287e6cacf591a86a (diff)
downloadrtmux-9002e60adf4201c08ecb5ce849b7d3eda89060c8.tar.gz
rtmux-9002e60adf4201c08ecb5ce849b7d3eda89060c8.tar.bz2
rtmux-9002e60adf4201c08ecb5ce849b7d3eda89060c8.zip
Sync OpenBSD patchset 213:
Don't try to free old string values (and crash) when they are overridden unless they were actually found in the source terminal description. Reported by jmc.
-rw-r--r--tty-term.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tty-term.c b/tty-term.c
index 45e7e7f8..6172941c 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -1,4 +1,4 @@
-/* $Id: tty-term.c,v 1.26 2009-08-09 15:29:54 tcunha Exp $ */
+/* $Id: tty-term.c,v 1.27 2009-08-09 15:57:13 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -195,7 +195,8 @@ tty_term_override(struct tty_term *term, const char *overrides)
case TTYCODE_NONE:
break;
case TTYCODE_STRING:
- xfree(code->value.string);
+ if (code->type == TTYCODE_STRING)
+ xfree(code->value.string);
code->value.string = xstrdup(val);
code->type = ent->type;
break;