diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-08-14 14:54:53 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-14 14:54:54 -0700 |
| commit | c147b41f4c450d687759e3fa25c24e5087a97f05 (patch) | |
| tree | ac2f02fda46f59da67f2691514fd9b116df8807c | |
| parent | dfaa04f3c606745a06f6eb4ef6cc1afe3c072f15 (diff) | |
| parent | d98d9c77e5d9ac0b0663069e05a512037b9279cf (diff) | |
| download | git-c147b41f4c450d687759e3fa25c24e5087a97f05.tar.gz | |
Merge branch 'jc/leakfix-mailmap'
Leakfix.
* jc/leakfix-mailmap:
mailmap: plug memory leak in read_mailmap_blob()
| -rw-r--r-- | mailmap.c | 4 | ||||
| -rwxr-xr-x | t/t4203-mailmap.sh | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -201,8 +201,10 @@ static int read_mailmap_blob(struct string_list *map, const char *name) buf = repo_read_object_file(the_repository, &oid, &type, &size); if (!buf) return error("unable to read mailmap object at %s", name); - if (type != OBJ_BLOB) + if (type != OBJ_BLOB) { + free(buf); return error("mailmap is not a blob: %s", name); + } read_mailmap_string(map, buf); diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 8a88dd7900..79e5f42760 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -5,6 +5,7 @@ test_description='.mailmap configurations' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success 'setup commits and contacts file' ' |
