From: Jonathan Tan Date: Tue, 08 May 2018 17:45:51 GMT Subject: Re: [PATCH v2 13/13] alloc: allow arbitrary repositories for alloc functions Message-ID: <20180508104551.8af4e13823a26680f07611be@google.com> In-Reply-To: <20180507225916.155236-14-sbeller@google.com> On Mon, 7 May 2018 15:59:16 -0700 Stefan Beller wrote: > + for (i = 0; i < o->obj_hash_size; i++) { > + struct object *obj = o->obj_hash[i]; > + > + if (!obj) > + continue; > + > + if (obj->type == OBJ_TREE) { > + free(((struct tree*)obj)->buffer); > + } else if (obj->type == OBJ_COMMIT) { > + free_commit_list(((struct commit*)obj)->parents); > + free(&((struct commit*)obj)->util); > + } Besides the other comments by Peff and Duy, should the "tag" field of a tag object be freed too? It is allocated by xmemdupz in tag.c, and is not assigned to by any other code (verified by renaming it and then fixing the compile errors one by one). Other than that, and other than my small comment on patch 1, this patch set looks good to me.