mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Don't leak if arguments appear multiple times, from Tiago Cunha.
This commit is contained in:
parent
8865eb2866
commit
c0d3e4315c
@ -79,6 +79,7 @@ cmd_bind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
|
|||||||
data->can_repeat = 1;
|
data->can_repeat = 1;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
|
if (data->tablename == NULL)
|
||||||
data->tablename = xstrdup(optarg);
|
data->tablename = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -61,9 +61,11 @@ cmd_switch_client_parse(struct cmd *self, int argc, char **argv, char **cause)
|
|||||||
while ((opt = getopt(argc, argv, "c:t:")) != -1) {
|
while ((opt = getopt(argc, argv, "c:t:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'c':
|
case 'c':
|
||||||
|
if (data->name == NULL)
|
||||||
data->name = xstrdup(optarg);
|
data->name = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
|
if (data->target == NULL)
|
||||||
data->target = xstrdup(optarg);
|
data->target = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -67,6 +67,7 @@ cmd_unbind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
|
|||||||
no_prefix = 1;
|
no_prefix = 1;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
|
if (data->tablename == NULL)
|
||||||
data->tablename = xstrdup(optarg);
|
data->tablename = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user