-list2_t* list_cpy (list2_t* l) {
- list2_t* ret = NULL;
- if (list_empty(l))
- return (NULL);
- ret = list_new ();
- ret->length = l->length;
- ret->data = mem_malloc (l->length*sizeof(void*));
- memcpy (ret->data, l->data, l->length*sizeof(void*));
- return (ret);
+list2_t *list_cpy(list2_t *l) {
+ list2_t* ret = NULL;
+ if (list_empty(l))
+ return NULL;
+ ret = list_new();
+ ret->length = l->length;
+ ret->data = p_dup(l->data, l->length);
+ return ret;