mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
resolve-tool: use reallocarray() where appropriate
This commit is contained in:
parent
ae934a7325
commit
3209c8e650
@ -2116,7 +2116,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to parse DNS server address: %s", optarg);
|
return log_error_errno(r, "Failed to parse DNS server address: %s", optarg);
|
||||||
|
|
||||||
n = realloc(arg_set_dns, sizeof(struct in_addr_data) * (arg_n_set_dns + 1));
|
n = reallocarray(arg_set_dns, arg_n_set_dns + 1, sizeof(struct in_addr_data));
|
||||||
if (!n)
|
if (!n)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
arg_set_dns = n;
|
arg_set_dns = n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user