summaryrefslogtreecommitdiffstats
path: root/src/shared/dns-domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-11-06 20:24:30 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-04 11:07:06 +0100
commitcb3714d100f5c59bd8da4f70a2bf77f5740a73eb (patch)
tree74260f9f2a266b3530eae4b14fad438de1648cfc /src/shared/dns-domain.c
parentmeson: check that cxx variable is set before using it (diff)
downloadsystemd-cb3714d100f5c59bd8da4f70a2bf77f5740a73eb.tar.xz
systemd-cb3714d100f5c59bd8da4f70a2bf77f5740a73eb.zip
dns-domain: follow coding style, initialize ret params on success
Diffstat (limited to 'src/shared/dns-domain.c')
-rw-r--r--src/shared/dns-domain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index b02ad3f521..97fa2eca5d 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -1308,18 +1308,19 @@ int dns_name_apply_idna(const char *name, char **ret) {
if (r != IDN2_OK) {
log_debug("idn2_to_unicode_8z8z(\"%s\") failed: %d/%s",
t, r, sym_idn2_strerror(r));
+ *ret = NULL;
return 0;
}
if (!streq_ptr(name, s)) {
log_debug("idn2 roundtrip failed: \"%s\" → \"%s\" → \"%s\", ignoring.",
name, t, s);
+ *ret = NULL;
return 0;
}
}
*ret = TAKE_PTR(t);
-
return 1; /* *ret has been written */
}
@@ -1329,6 +1330,7 @@ int dns_name_apply_idna(const char *name, char **ret) {
return 0;
if (IN_SET(r, IDN2_TOO_BIG_DOMAIN, IDN2_TOO_BIG_LABEL))
return -ENOSPC;
+
return -EINVAL;
#elif HAVE_LIBIDN
_cleanup_free_ char *buf = NULL;