From: Eric Sunshine Date: Tue, 17 May 2016 03:42:46 GMT Subject: Re: [PATCH 2/3] pack-redundant: free all memory Message-ID: In-Reply-To: <20160517032247.25092-3-sbeller@google.com> On Mon, May 16, 2016 at 11:22 PM, Stefan Beller wrote: > Signed-off-by: Stefan Beller > --- > 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) s/inline// > +{ > + struct pack_list *cur_pl; You can declare this within the scope of the while-loop. > + while (pl) { > + llist_free(pl->unique_objects); > + llist_free(pl->all_objects); > + cur_pl = pl; > + pl = pl->next; > + free(cur_pl); > + } > +}