summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-05-22 14:24:44 +0000
committernectar <nectar@FreeBSD.org>2002-05-22 14:24:44 +0000
commitb8aa530e782d43d47e412a3fe14fc87574657604 (patch)
treed4b3a5315a84910633d57a599a6a5cdf329d1c54 /contrib
parenta9a1aecd794e14f6c2104a09dcc4aff4d6602272 (diff)
downloadFreeBSD-src-b8aa530e782d43d47e412a3fe14fc87574657604.zip
FreeBSD-src-b8aa530e782d43d47e412a3fe14fc87574657604.tar.gz
Do not attempt to free static memory.
Reference ISC BIND issue: ``1278. [bug] free() of non-malloced memory in nslookup.'' Reported by: phkmalloc, Mike Tancsa <mike@sentex.net>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bind/bin/nslookup/getinfo.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/contrib/bind/bin/nslookup/getinfo.c b/contrib/bind/bin/nslookup/getinfo.c
index b0faab9..331d6d5 100644
--- a/contrib/bind/bin/nslookup/getinfo.c
+++ b/contrib/bind/bin/nslookup/getinfo.c
@@ -387,10 +387,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer,
for (l = 0; l < k; l++)
if (!strcasecmp(hostPtr->aliases[l], host_aliases[i]))
break;
- if (l < k) {
- free(host_aliases[i]);
+ if (l < k)
continue;
- }
hostPtr->aliases[k] = Calloc(1, host_aliases_len[i]);
memcpy(hostPtr->aliases[k], host_aliases[i],
host_aliases_len[i]);
@@ -420,10 +418,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer,
!memcmp(hostPtr->addrList[l]->addr, addr_list[i],
addr_len[i]))
break;
- if (l < k) {
- free(addr_list[i]);
+ if (l < k)
continue;
- }
hostPtr->addrList[k] = (AddrInfo*)Calloc(1, sizeof(AddrInfo));
hostPtr->addrList[k]->addr = Calloc(1, addr_len[i]);
hostPtr->addrList[k]->addrType = addr_type[i];
OpenPOWER on IntegriCloud