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) ...@@ -97,7 +97,7 @@ assoc_rehash (mu_assoc_t assoc)
97 if (hash_num >= max_rehash) 97 if (hash_num >= max_rehash)
98 return MU_ERR_BUFSPACE; 98 return MU_ERR_BUFSPACE;
99 99
100 new_tab = calloc (hash_size[hash_num], assoc->elsize); 100 new_tab = calloc (hash_size[hash_num], ASSOC_ELEM_SIZE (assoc));
101 assoc->tab = new_tab; 101 assoc->tab = new_tab;
102 if (old_tab) 102 if (old_tab)
103 { 103 {
...@@ -114,7 +114,7 @@ assoc_rehash (mu_assoc_t assoc) ...@@ -114,7 +114,7 @@ assoc_rehash (mu_assoc_t assoc)
114 if (rc) 114 if (rc)
115 return rc; 115 return rc;
116 newp->name = elt->name; 116 newp->name = elt->name;
117 memcpy(newp->data, elt->data, assoc->elsize);; 117 memcpy(newp->data, elt->data, assoc->elsize);
118 } 118 }
119 } 119 }
120 free (old_tab); 120 free (old_tab);
......