diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-03 15:30:16 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-03 15:30:16 +0000 |
commit | ac54dee9bbd33e71910fed8d5f8ddb1cde9b9a35 (patch) | |
tree | 63c4a404fd123073c586028289405907be0b31f0 | |
parent | 9a391b33202fbab9a76812a763ac6252187bafdd (diff) |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |