From: Jeff King Date: Wed, 27 May 2020 18:55:06 GMT Subject: Re: [PATCH 12/12] upload-pack: move pack_objects_hook to upload_pack_data Message-ID: <20200527185506.GI4020820@coredump.intra.peff.net> In-Reply-To: <20200527164742.23067-13-chriscool@tuxfamily.org> On Wed, May 27, 2020 at 06:47:42PM +0200, Christian Couder wrote: > As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' > more thoroughly, let's move the 'pack_objects_hook' static > variable into this struct. > > It is used by code common to protocol v0 and protocol v2. > > While at it let's also free() it in upload_pack_data_clear(). Makes sense. > @@ -133,6 +134,8 @@ static void upload_pack_data_clear(struct upload_pack_data *data) > object_array_clear(&data->shallows); > string_list_clear(&data->deepen_not, 0); > list_objects_filter_release(&data->filter_options); > + > + free((char *)data->pack_objects_hook); This cast is ugly, but unavoidable because git_config_string() takes a pointer-to-const. -Peff