Commit 92b3033c 92b3033c2c969e3499425a4159aaee1b13bb40a2 by Sergey Poznyakoff

(assoc_rehash): Fix an incorrect element size calculation.

1 parent ccb7ad7f
......@@ -97,7 +97,7 @@ assoc_rehash (mu_assoc_t assoc)
if (hash_num >= max_rehash)
return MU_ERR_BUFSPACE;
new_tab = calloc (hash_size[hash_num], assoc->elsize);
new_tab = calloc (hash_size[hash_num], ASSOC_ELEM_SIZE (assoc));
assoc->tab = new_tab;
if (old_tab)
{
......@@ -114,7 +114,7 @@ assoc_rehash (mu_assoc_t assoc)
if (rc)
return rc;
newp->name = elt->name;
memcpy(newp->data, elt->data, assoc->elsize);;
memcpy(newp->data, elt->data, assoc->elsize);
}
}
free (old_tab);
......