mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
Fix two memory leaks when assigning shell variables in configuration
file/command prompt. From Tiago Cunha.
This commit is contained in:
parent
8c497ecac0
commit
f63761eabc
1 changed files with 2 additions and 0 deletions
|
|
@ -114,6 +114,7 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
|
|||
buf = xrealloc(buf, 1, len + strlen(t) + 1);
|
||||
strlcpy(buf + len, t, strlen(t) + 1);
|
||||
len += strlen(t);
|
||||
xfree(t);
|
||||
|
||||
have_arg = 1;
|
||||
break;
|
||||
|
|
@ -219,6 +220,7 @@ cmd_string_string(const char *s, size_t *p, char endch, int esc)
|
|||
buf = xrealloc(buf, 1, len + strlen(t) + 1);
|
||||
strlcpy(buf + len, t, strlen(t) + 1);
|
||||
len += strlen(t);
|
||||
xfree(t);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue