mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-16 16:41:35 +02:00
Don't leak if arguments appear multiple times, from Tiago Cunha.
This commit is contained in:
@ -61,10 +61,12 @@ cmd_switch_client_parse(struct cmd *self, int argc, char **argv, char **cause)
|
||||
while ((opt = getopt(argc, argv, "c:t:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'c':
|
||||
data->name = xstrdup(optarg);
|
||||
if (data->name == NULL)
|
||||
data->name = xstrdup(optarg);
|
||||
break;
|
||||
case 't':
|
||||
data->target = xstrdup(optarg);
|
||||
if (data->target == NULL)
|
||||
data->target = xstrdup(optarg);
|
||||
break;
|
||||
default:
|
||||
goto usage;
|
||||
|
Reference in New Issue
Block a user