diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-25 21:40:09 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-26 03:23:36 +0200 |
commit | 764dca0edcb66df97c1431421b731143b8d8ef5e (patch) | |
tree | d826061eca29d8c3988f0d5556e0bc73ac53a00d /src | |
parent | Merge pull request #19722 from poettering/empty-string-loginctl-man (diff) | |
download | systemd-764dca0edcb66df97c1431421b731143b8d8ef5e.tar.xz systemd-764dca0edcb66df97c1431421b731143b8d8ef5e.zip |
dns-domain: fix build failure with libidn
Follow-up for 319a4f4bc46b230fc660321e99aaac1bc449deea.
Fixes #19723.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/dns-domain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 216e1a0647..787bb8fec9 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -1335,7 +1335,7 @@ int dns_name_apply_idna(const char *name, char **ret) { return -EINVAL; #elif HAVE_LIBIDN _cleanup_free_ char *buf = NULL; - size_t n = 0, allocated = 0; + size_t n = 0; bool first = true; int r, q; @@ -1357,7 +1357,7 @@ int dns_name_apply_idna(const char *name, char **ret) { if (q > 0) r = q; - if (!GREEDY_REALLOC(buf, allocated, n + !first + DNS_LABEL_ESCAPED_MAX)) + if (!GREEDY_REALLOC(buf, n + !first + DNS_LABEL_ESCAPED_MAX)) return -ENOMEM; r = dns_label_escape(label, r, buf + n + !first, DNS_LABEL_ESCAPED_MAX); @@ -1375,7 +1375,7 @@ int dns_name_apply_idna(const char *name, char **ret) { if (n > DNS_HOSTNAME_MAX) return -EINVAL; - if (!GREEDY_REALLOC(buf, allocated, n + 1)) + if (!GREEDY_REALLOC(buf, n + 1)) return -ENOMEM; buf[n] = 0; |