From: John Kohl Date: Wed, 30 May 1990 15:34:00 +0000 (+0000) Subject: patch XNS code to be like INET code X-Git-Tag: krb5-1.0-alpha2~441 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c5a6192e0a5efe0cd2ee21c6f6c7d5593d19f1c3;p=krb5.git patch XNS code to be like INET code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@966 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index fcd7be862..68bc749f9 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -162,8 +162,17 @@ krb5_error_code krb5_os_localaddr(addr) /* XXX should we perhaps use ns_host instead? */ address->length = sizeof(struct ns_addr); - memcpy ((char *)address->contents, (char *)&ns->sns_addr, - address->length); + address->contents = (unsigned char *)malloc(address->length); + if (!address->contents) { + free((char *)address); + address = 0; + mem_err++; + } else { + memcpy ((char *)address->contents, + (char *)&ns->sns_addr, + address->length); + break; + } } else mem_err++; break; }