mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +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)
|
||||
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)
|
||||
return log_oom();
|
||||
arg_set_dns = n;
|
||||
|
Loading…
Reference in New Issue
Block a user