fetch-pack: free object filter before exiting
Our fetch_pack_args holds a filter_options struct that may be populated with allocated strings by the by the "--filter" command-line option. We must free it before exiting to avoid a leak when the program exits. The usual fetch code paths that use transport.c don't have the same leak, because we do the cleanup in disconnect_git(). Fixing this leak lets us mark t5500 as leak-free. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									91aa673539
								
							
						
					
					
						commit
						0c23f1a9e4
					
				|  | @ -293,5 +293,6 @@ int cmd_fetch_pack(int argc, | ||||||
| 	free(sought); | 	free(sought); | ||||||
| 	free_refs(fetched_refs); | 	free_refs(fetched_refs); | ||||||
| 	free_refs(remote_refs); | 	free_refs(remote_refs); | ||||||
|  | 	list_objects_filter_release(&args.filter_options); | ||||||
| 	return ret; | 	return ret; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -8,6 +8,7 @@ test_description='Testing multi_ack pack fetching' | ||||||
| GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main | ||||||
| export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME | ||||||
|  |  | ||||||
|  | TEST_PASSES_SANITIZE_LEAK=true | ||||||
| . ./test-lib.sh | . ./test-lib.sh | ||||||
|  |  | ||||||
| # Test fetch-pack/upload-pack pair. | # Test fetch-pack/upload-pack pair. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Jeff King
						Jeff King