aboutsummaryrefslogtreecommitdiffstats
path: root/smtpd/util.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-11-04 23:09:46 +0000
committerGilles Chehade <gilles@poolp.org>2019-11-04 23:09:46 +0000
commit00e635107d86d4c150bbdcea983d2dc2c49165c6 (patch)
tree23824079e34982d5f5daadb6ee6a2db91d28d34d /smtpd/util.c
parenttime_t is not 64-bits everywhere (diff)
downloadOpenSMTPD-00e635107d86d4c150bbdcea983d2dc2c49165c6.tar.xz
OpenSMTPD-00e635107d86d4c150bbdcea983d2dc2c49165c6.zip
provide a portable freeaddrinfo() variant s
Diffstat (limited to '')
-rw-r--r--smtpd/util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/smtpd/util.c b/smtpd/util.c
index 38bbd8c1..eec3a303 100644
--- a/smtpd/util.c
+++ b/smtpd/util.c
@@ -855,3 +855,16 @@ xclosefrom(int lowfd)
closefrom(lowfd);
#endif
}
+
+void
+portable_freeaddrinfo(struct addrinfo *ai)
+{
+ struct addrinfo *p;
+
+ do {
+ p = ai;
+ ai = ai->ai_next;
+ free(p->ai_canonname);
+ free(p);
+ } while (ai);
+}