diff options
author | ume <ume@FreeBSD.org> | 2005-01-28 19:35:42 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-01-28 19:35:42 +0000 |
commit | 306734fccba0ad99029639bf75481ce94e920f4a (patch) | |
tree | c5666c7607c3788b6d282a7bb577d589c1656491 /lib | |
parent | da8e6b049d64000330d05849f934c53d0de9d4be (diff) | |
download | FreeBSD-src-306734fccba0ad99029639bf75481ce94e920f4a.zip FreeBSD-src-306734fccba0ad99029639bf75481ce94e920f4a.tar.gz |
use strdup().
Obtained from: KAME
MFC after: 1 week
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 9029967..29b1f6d 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1331,10 +1331,9 @@ get_canonname(pai, ai, str) const char *str; { if ((pai->ai_flags & AI_CANONNAME) != 0) { - ai->ai_canonname = (char *)malloc(strlen(str) + 1); + ai->ai_canonname = strdup(str); if (ai->ai_canonname == NULL) return EAI_MEMORY; - strlcpy(ai->ai_canonname, str, strlen(str) + 1); } return 0; } |