mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-20 11:44:31 +00:00
Clean up some leaks in the test suite
This commit is contained in:
parent
ecef28d55c
commit
25abbc27a7
@ -1088,9 +1088,11 @@ int git_path_dirload(
|
||||
entry_path[path_len] = '/';
|
||||
memcpy(&entry_path[path_len + need_slash], de_path, de_len);
|
||||
|
||||
if ((error = git_vector_insert(contents, entry_path)) < 0)
|
||||
if ((error = git_vector_insert(contents, entry_path)) < 0) {
|
||||
git__free(entry_path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
|
||||
|
@ -547,6 +547,7 @@ void test_network_remote_remotes__single_branch(void)
|
||||
}
|
||||
cl_assert_equal_i(1, count);
|
||||
|
||||
git_strarray_free(&refs);
|
||||
git_repository_free(repo);
|
||||
}
|
||||
|
||||
|
@ -423,6 +423,7 @@ void test_repo_init__relative_gitdir_2(void)
|
||||
|
||||
/* make the directory first, then it should succeed */
|
||||
cl_git_pass(git_repository_init_ext(&_repo, "root/b/my_repository", &opts));
|
||||
git_buf_free(&full_path);
|
||||
|
||||
cl_assert(!git__suffixcmp(git_repository_workdir(_repo), "root/b/c_wd/"));
|
||||
cl_assert(!git__suffixcmp(git_repository_path(_repo), "root/b/my_repository/"));
|
||||
|
@ -47,6 +47,7 @@ void test_transport_register__custom_transport_ssh(void)
|
||||
cl_git_fail_with(git_transport_new(&transport, NULL, "git@somehost:somepath"), -1);
|
||||
#else
|
||||
cl_git_pass(git_transport_new(&transport, NULL, "git@somehost:somepath"));
|
||||
transport->free(transport);
|
||||
#endif
|
||||
|
||||
cl_git_pass(git_transport_register("ssh", dummy_transport, NULL));
|
||||
@ -62,5 +63,6 @@ void test_transport_register__custom_transport_ssh(void)
|
||||
cl_git_fail_with(git_transport_new(&transport, NULL, "git@somehost:somepath"), -1);
|
||||
#else
|
||||
cl_git_pass(git_transport_new(&transport, NULL, "git@somehost:somepath"));
|
||||
transport->free(transport);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user