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.
pull/1/head
Nicholas Marriott 2009-08-03 15:30:16 +00:00
parent 9a391b3320
commit ac54dee9bb
1 changed files with 2 additions and 1 deletions

View File

@ -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;