Re: [PATCH 2/3] pack-redundant: free all memory
On Mon, May 16, 2016 at 11:22 PM, Stefan Beller <sbeller@google.com> wrote:
Show 5 quoted lines
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
> @@ -223,6 +223,18 @@ static inline size_t pack_list_size(struct pack_list *pl)
> +static inline void pack_list_free(struct pack_list *pl)
> +{
> + struct pack_list *cur_pl;You can declare this within the scope of the while-loop.
Show 8 quoted lines
> + while (pl) {
> + llist_free(pl->unique_objects);
> + llist_free(pl->all_objects);
> + cur_pl = pl;
> + pl = pl->next;
> + free(cur_pl);
> + }
> +}