mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-06 04:10:10 +00:00
ahost: Allow repeated -s <domain> options
This also removes a potential leak where later -s options would replace earlier ones without freeing the relevant string.
This commit is contained in:
7
ahost.c
7
ahost.c
@ -87,9 +87,10 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 's':
|
||||
optmask |= ARES_OPT_DOMAINS;
|
||||
options.ndomains = 1;
|
||||
options.domains = malloc(options.ndomains * sizeof(char *));
|
||||
options.domains[0] = strdup(optarg);
|
||||
options.ndomains++;
|
||||
options.domains = realloc(options.domains,
|
||||
options.ndomains * sizeof(char *));
|
||||
options.domains[options.ndomains - 1] = strdup(optarg);
|
||||
break;
|
||||
case 't':
|
||||
if (!strcasecmp(optarg,"a"))
|
||||
|
Reference in New Issue
Block a user