diff options
-rw-r--r-- | lib/ippool.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ippool.c b/lib/ippool.c index 6561f1f..6ce3cda 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -276,9 +276,8 @@ int ippool_new(struct ippool_t **this, const struct in46_prefix *dyn, const stru (*this)->hashmask = (*this)->hashsize - 1; /* Allocate hash table */ - if (! - ((*this)->hash = - calloc(sizeof(struct ippoolm_t), (*this)->hashsize))) { + (*this)->hash = calloc((*this)->hashsize, sizeof(struct ippoolm_t *)); + if (!(*this)->hash) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to allocate memory for hash members in ippool"); return -1; |