X-Git-Url: https://git.wpitchoune.net/gitweb/?p=ppastats.git;a=blobdiff_plain;f=src%2Flp.c;h=11866d76b46944bdbe610c4119469bb8756489f3;hp=e738a6c1e909a7740b57160b5725ee71f047cdf5;hb=7322824fadde9e95f79c630b70b25a8a660ab503;hpb=2c7fa14b8c232ba26636e4ca80e57d11f0ba9694 diff --git a/src/lp.c b/src/lp.c index e738a6c..11866d7 100644 --- a/src/lp.c +++ b/src/lp.c @@ -175,7 +175,7 @@ void daily_download_total_list_free(struct daily_download_total **list) 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++) { @@ -185,7 +185,11 @@ struct bpph **bpph_list_add(struct bpph **list, struct bpph *new) 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)