pack-objects: free packing_data in more places
The pack-objects internals use a packing_data struct to track what objects are part of the pack(s) being formed. Since these structures contain allocated fields, failing to appropriately free() them results in a leak. Plug that leak by introducing a clear_packing_data() function, and call it in the appropriate spots. This is a fairly straightforward leak to plug, since none of the callers expect to read any values or have any references to parts of the address space being freed. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1a87c842ec
commit
66f0c71073
@ -4522,6 +4522,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||
reuse_packfile_objects);
|
||||
|
||||
cleanup:
|
||||
clear_packing_data(&to_pack);
|
||||
list_objects_filter_release(&filter_options);
|
||||
strvec_clear(&rp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user