diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-01-23 17:50:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-01-23 17:50:56 +0000 |
commit | c0d3e4315c4465d2c665ab2a9151ac31e72f6882 (patch) | |
tree | cd4ee258223647b836a87a7f7b6b0617c5d1cfd3 /cmd-switch-client.c | |
parent | 8865eb2866971d1f82876546154f3032e915348b (diff) | |
download | rtmux-c0d3e4315c4465d2c665ab2a9151ac31e72f6882.tar.gz rtmux-c0d3e4315c4465d2c665ab2a9151ac31e72f6882.tar.bz2 rtmux-c0d3e4315c4465d2c665ab2a9151ac31e72f6882.zip |
Don't leak if arguments appear multiple times, from Tiago Cunha.
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r-- | cmd-switch-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c index 9ff1c081..03cb7c8d 100644 --- a/cmd-switch-client.c +++ b/cmd-switch-client.c @@ -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; |