struct bpph **bpph_list_add(struct bpph **list, struct bpph *new)
{
- struct bpph **cur, *bpph;
+ struct bpph **cur, *bpph, **result;
if (list)
for (cur = list; *cur; cur++) {
return list;
}
- return (struct bpph **)list_add((void **)list, new);
+ result = (struct bpph **)list_add((void **)list, new);
+
+ free(list);
+
+ return result;
}
struct bpph **bpph_list_append_list(struct bpph **list1, struct bpph **list2)