summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-04-02 21:38:58 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-04-02 21:38:58 +0000
commit5b14fea36497511e6428b2c588513d92bc92cb90 (patch)
tree0b66759932d131cfb42148e0672334d215e6b99f /usr.sbin/bind/lib
parentba37f6b6fd488dbe7dd7be429e8b7a994a783155 (diff)
malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaks
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
Diffstat (limited to 'usr.sbin/bind/lib')
-rw-r--r--usr.sbin/bind/lib/lwres/getipnode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/lwres/getipnode.c b/usr.sbin/bind/lib/lwres/getipnode.c
index 8a11b474a3c..6d9b6669922 100644
--- a/usr.sbin/bind/lib/lwres/getipnode.c
+++ b/usr.sbin/bind/lib/lwres/getipnode.c
@@ -753,10 +753,9 @@ copyandmerge(struct hostent *he1, struct hostent *he2, int af, int *error_num)
if (he == NULL)
goto no_recovery;
- he->h_addr_list = malloc(sizeof(char *) * (addresses));
+ he->h_addr_list = calloc(addresses, sizeof(char *));
if (he->h_addr_list == NULL)
goto cleanup0;
- memset(he->h_addr_list, 0, sizeof(char *) * (addresses));
/*
* Copy addresses.