diff options
author | 2019-11-04 23:09:46 +0000 | |
---|---|---|
committer | 2019-11-04 23:09:46 +0000 | |
commit | 00e635107d86d4c150bbdcea983d2dc2c49165c6 (patch) | |
tree | 23824079e34982d5f5daadb6ee6a2db91d28d34d /smtpd/util.c | |
parent | time_t is not 64-bits everywhere (diff) | |
download | OpenSMTPD-00e635107d86d4c150bbdcea983d2dc2c49165c6.tar.xz OpenSMTPD-00e635107d86d4c150bbdcea983d2dc2c49165c6.zip |
provide a portable freeaddrinfo() variant s
Diffstat (limited to '')
-rw-r--r-- | smtpd/util.c | 13 |
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); +} |