Merge branch 'jc/leakfix-mailmap'
Leakfix. * jc/leakfix-mailmap: mailmap: plug memory leak in read_mailmap_blob()
This commit is contained in:
@ -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);
|
buf = repo_read_object_file(the_repository, &oid, &type, &size);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return error("unable to read mailmap object at %s", name);
|
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);
|
return error("mailmap is not a blob: %s", name);
|
||||||
|
}
|
||||||
|
|
||||||
read_mailmap_string(map, buf);
|
read_mailmap_string(map, buf);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ test_description='.mailmap configurations'
|
|||||||
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_expect_success 'setup commits and contacts file' '
|
test_expect_success 'setup commits and contacts file' '
|
||||||
|
Reference in New Issue
Block a user