diff options
author | Jeff King <peff@peff.net> | 2020-02-13 03:16:33 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-13 18:08:58 +0100 |
commit | acac50dd8c2c9725841b3e9143d78c6345dc076c (patch) | |
tree | afa32ba98f25de1dff2bd6cae0ea4f3cda6b8fc9 /object.c | |
parent | pack-bitmap: factor out type iterator initialization (diff) | |
download | git-acac50dd8c2c9725841b3e9143d78c6345dc076c.tar.xz git-acac50dd8c2c9725841b3e9143d78c6345dc076c.zip |
pack-bitmap: fix leak of haves/wants object lists
When we do a bitmap-aware revision traversal, we create an object_list
for each of the "haves" and "wants" tips. After creating the result
bitmaps these are no longer needed or used, but we never free the list
memory.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -307,6 +307,15 @@ int object_list_contains(struct object_list *list, struct object *obj) return 0; } +void object_list_free(struct object_list **list) +{ + while (*list) { + struct object_list *p = *list; + *list = p->next; + free(p); + } +} + /* * A zero-length string to which object_array_entry::name can be * initialized without requiring a malloc/free. |