builtin/log: fix leak when showing converted blob contents
In `show_blob_object()`, we proactively call `textconv_object()`. In case we have a textconv driver for this blob we will end up showing the converted contents, otherwise we'll show the un-converted contents of it instead. When the object has been converted we never free the buffer containing the converted contents. Fix this to plug this memory leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									38678e5df5
								
							
						
					
					
						commit
						0aaca0ec09
					
				|  | @ -707,6 +707,7 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c | |||
|  | ||||
| 	write_or_die(1, buf, size); | ||||
| 	object_context_release(&obj_context); | ||||
| 	free(buf); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| #!/bin/sh | ||||
|  | ||||
| test_description='diff.*.textconv tests' | ||||
|  | ||||
| TEST_PASSES_SANITIZE_LEAK=true | ||||
| . ./test-lib.sh | ||||
|  | ||||
| find_diff() { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Patrick Steinhardt
						Patrick Steinhardt