From ac54dee9bbd33e71910fed8d5f8ddb1cde9b9a35 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 3 Aug 2009 15:30:16 +0000 Subject: [PATCH] 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. --- tty-term.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tty-term.c b/tty-term.c index 2813be61..c96bdb12 100644 --- a/tty-term.c +++ b/tty-term.c @@ -196,7 +196,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;