summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/canohost.c b/canohost.c
index 9a00fc2cf..8e81b5193 100644
--- a/canohost.c
+++ b/canohost.c
@@ -60,7 +60,7 @@ remote_hostname(struct ssh *ssh)
60 if (getpeername(ssh_packet_get_connection_in(ssh), 60 if (getpeername(ssh_packet_get_connection_in(ssh),
61 (struct sockaddr *)&from, &fromlen) == -1) { 61 (struct sockaddr *)&from, &fromlen) == -1) {
62 debug("getpeername failed: %.100s", strerror(errno)); 62 debug("getpeername failed: %.100s", strerror(errno));
63 return strdup(ntop); 63 return xstrdup(ntop);
64 } 64 }
65 65
66 ipv64_normalise_mapped(&from, &fromlen); 66 ipv64_normalise_mapped(&from, &fromlen);
@@ -72,7 +72,7 @@ remote_hostname(struct ssh *ssh)
72 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), 72 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
73 NULL, 0, NI_NAMEREQD) != 0) { 73 NULL, 0, NI_NAMEREQD) != 0) {
74 /* Host name not found. Use ip address. */ 74 /* Host name not found. Use ip address. */
75 return strdup(ntop); 75 return xstrdup(ntop);
76 } 76 }
77 77
78 /* 78 /*
@@ -87,7 +87,7 @@ remote_hostname(struct ssh *ssh)
87 logit("Nasty PTR record \"%s\" is set up for %s, ignoring", 87 logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
88 name, ntop); 88 name, ntop);
89 freeaddrinfo(ai); 89 freeaddrinfo(ai);
90 return strdup(ntop); 90 return xstrdup(ntop);
91 } 91 }
92 92
93 /* Names are stored in lowercase. */ 93 /* Names are stored in lowercase. */
@@ -108,7 +108,7 @@ remote_hostname(struct ssh *ssh)
108 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { 108 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) {
109 logit("reverse mapping checking getaddrinfo for %.700s " 109 logit("reverse mapping checking getaddrinfo for %.700s "
110 "[%s] failed.", name, ntop); 110 "[%s] failed.", name, ntop);
111 return strdup(ntop); 111 return xstrdup(ntop);
112 } 112 }
113 /* Look for the address from the list of addresses. */ 113 /* Look for the address from the list of addresses. */
114 for (ai = aitop; ai; ai = ai->ai_next) { 114 for (ai = aitop; ai; ai = ai->ai_next) {
@@ -123,9 +123,9 @@ remote_hostname(struct ssh *ssh)
123 /* Address not found for the host name. */ 123 /* Address not found for the host name. */
124 logit("Address %.100s maps to %.600s, but this does not " 124 logit("Address %.100s maps to %.600s, but this does not "
125 "map back to the address.", ntop, name); 125 "map back to the address.", ntop, name);
126 return strdup(ntop); 126 return xstrdup(ntop);
127 } 127 }
128 return strdup(name); 128 return xstrdup(name);
129} 129}
130 130
131void 131void