diff options
author | John Denker <jsd@av8n.com> | 2012-07-26 10:57:13 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-07-29 15:32:37 -0700 |
commit | 9aa998757a8736cef02fd92050eacbb2a6fb5180 (patch) | |
tree | 18ae3d172893279aecaf12df94cb468bf887aa72 /ucspi-tcp-0.88/dns_dfd.c | |
parent | 6e8083ff4ffe3fd2b6d337386637a2b5c1378cf7 (diff) |
patch to support IPv6 in tcpserver
Diffstat (limited to 'ucspi-tcp-0.88/dns_dfd.c')
-rw-r--r-- | ucspi-tcp-0.88/dns_dfd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ucspi-tcp-0.88/dns_dfd.c b/ucspi-tcp-0.88/dns_dfd.c index 14a29d8..c924718 100644 --- a/ucspi-tcp-0.88/dns_dfd.c +++ b/ucspi-tcp-0.88/dns_dfd.c @@ -1,9 +1,10 @@ -#include "error.h" -#include "alloc.h" +#include <stdlib.h> +#include <errno.h> #include "byte.h" #include "dns.h" +#include "error.h" -int dns_domain_fromdot(char **out,char *buf,unsigned int n) +int dns_domain_fromdot(char **out,const char *buf,unsigned int n) { char label[63]; unsigned int labellen = 0; /* <= sizeof label */ @@ -59,11 +60,11 @@ int dns_domain_fromdot(char **out,char *buf,unsigned int n) if (namelen + 1 > sizeof name) return 0; name[namelen++] = 0; - x = alloc(namelen); + x = malloc(namelen); if (!x) return 0; byte_copy(x,namelen,name); - if (*out) alloc_free(*out); + if (*out) free(*out); *out = x; return 1; } |