Commit 0c3fed6e 0c3fed6e188fa392bacf9b66f04838baf2b7badc by Sergey Poznyakoff

(list_data_dup): Bugfix: *ptr was not assigned.

1 parent b077544f
...@@ -422,13 +422,10 @@ curitem_p (void *owner, void *item) ...@@ -422,13 +422,10 @@ curitem_p (void *owner, void *item)
422 static int 422 static int
423 list_data_dup (void **ptr, void *owner) 423 list_data_dup (void **ptr, void *owner)
424 { 424 {
425 struct list_iterator *itr = owner; 425 *ptr = malloc (sizeof (struct list_iterator));
426 struct list_iterator *clone; 426 if (*ptr == NULL)
427 clone = malloc (sizeof *itr);
428 if (clone == NULL)
429 return ENOMEM; 427 return ENOMEM;
430 /* let the assignement operator copy the elements. */ 428 memcpy (*ptr, owner, sizeof (struct list_iterator));
431 *clone = *itr;
432 return 0; 429 return 0;
433 } 430 }
434 431
......