mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-17 02:41:07 +01:00
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.
This commit is contained in:
parent
bd2fe4ce9b
commit
9002e60adf
@ -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>
|
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -195,6 +195,7 @@ tty_term_override(struct tty_term *term, const char *overrides)
|
|||||||
case TTYCODE_NONE:
|
case TTYCODE_NONE:
|
||||||
break;
|
break;
|
||||||
case TTYCODE_STRING:
|
case TTYCODE_STRING:
|
||||||
|
if (code->type == TTYCODE_STRING)
|
||||||
xfree(code->value.string);
|
xfree(code->value.string);
|
||||||
code->value.string = xstrdup(val);
|
code->value.string = xstrdup(val);
|
||||||
code->type = ent->type;
|
code->type = ent->type;
|
||||||
|
Loading…
Reference in New Issue
Block a user