From: Yu Watanabe Date: Tue, 25 May 2021 19:40:09 +0000 (+0900) Subject: dns-domain: fix build failure with libidn X-Git-Tag: v249-rc1~152 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=764dca0edcb66df97c1431421b731143b8d8ef5e;p=thirdparty%2Fsystemd.git dns-domain: fix build failure with libidn Follow-up for 319a4f4bc46b230fc660321e99aaac1bc449deea. Fixes #19723. --- diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 216e1a06471..787bb8fec94 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;