Commit c506db00 c506db00211d5aae43dcc7d0115d3a33bfa85c36 by Sergey Poznyakoff

(mu_iterator_detach): Bugfix.

1 parent 0814397d
...@@ -35,7 +35,7 @@ mu_iterator_create (mu_iterator_t *piterator, void *owner) ...@@ -35,7 +35,7 @@ mu_iterator_create (mu_iterator_t *piterator, void *owner)
35 return MU_ERR_OUT_PTR_NULL; 35 return MU_ERR_OUT_PTR_NULL;
36 if (owner == NULL) 36 if (owner == NULL)
37 return EINVAL; 37 return EINVAL;
38 iterator = calloc (sizeof (*iterator), 1); 38 iterator = calloc (1, sizeof (*iterator));
39 if (iterator == NULL) 39 if (iterator == NULL)
40 return ENOMEM; 40 return ENOMEM;
41 iterator->owner = owner; 41 iterator->owner = owner;
...@@ -239,7 +239,7 @@ mu_iterator_detach (mu_iterator_t *root, mu_iterator_t iterator) ...@@ -239,7 +239,7 @@ mu_iterator_detach (mu_iterator_t *root, mu_iterator_t iterator)
239 if (itr) 239 if (itr)
240 { 240 {
241 if (prev) 241 if (prev)
242 prev->next = itr->next; 242 prev->next_itr = itr->next_itr;
243 else 243 else
244 *root = itr->next_itr; 244 *root = itr->next_itr;
245 } 245 }
......