X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/087a9b2eaf10974c1b3025bf7d439c2371625e70..47854c5fdbdebaf707de438f0fa86c4cb99d2268:/clients/disorder.c diff --git a/clients/disorder.c b/clients/disorder.c index 1d55b8d..298494a 100644 --- a/clients/disorder.c +++ b/clients/disorder.c @@ -864,11 +864,14 @@ int main(int argc, char **argv) { } if(config_read(0, NULL)) disorder_fatal(0, "cannot read configuration"); if(user) { - config->username = user; + xfree(config->username); + config->username = xstrdup(user); config->password = 0; } - if(password) - config->password = password; + if(password) { + xfree(config->password); + config->password = xstrdup(password); + } if(local) config->connect.af = -1; if(wfr) @@ -899,10 +902,12 @@ int main(int argc, char **argv) { vector_append(&args, nullcheck(mb2utf8(argv[n + j]))); vector_terminate(&args); commands[i].fn(args.vec + 1); + xfree(args.vec); n += j; } if(client && disorder_close(client)) exit(EXIT_FAILURE); if(fclose(stdout) < 0) disorder_fatal(errno, "error closing stdout"); + config_free(config); return status; }