mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 13:48:41 +00:00
Plug a few leaks
This commit is contained in:
parent
c3ce8d0c9a
commit
cdca82c784
@ -552,6 +552,7 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo,
|
|||||||
|
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
giterr_set(GITERR_INVALID, "Invalid tree path '%s'", path);
|
giterr_set(GITERR_INVALID, "Invalid tree path '%s'", path);
|
||||||
|
git__free(alloc);
|
||||||
return GIT_ERROR;
|
return GIT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,6 +623,7 @@ static int revparse_global_grep(git_object **out, git_repository *repo, const ch
|
|||||||
}
|
}
|
||||||
if (!resultobj) {
|
if (!resultobj) {
|
||||||
giterr_set(GITERR_REFERENCE, "Couldn't find a match for %s", pattern);
|
giterr_set(GITERR_REFERENCE, "Couldn't find a match for %s", pattern);
|
||||||
|
git_object_free(walkobj);
|
||||||
} else {
|
} else {
|
||||||
*out = resultobj;
|
*out = resultobj;
|
||||||
}
|
}
|
||||||
|
@ -112,4 +112,6 @@ void test_core_env__1(void)
|
|||||||
|
|
||||||
cl_assert(git_futils_find_system_file(&path, "nonexistentfile") == -1);
|
cl_assert(git_futils_find_system_file(&path, "nonexistentfile") == -1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
git_buf_free(&path);
|
||||||
}
|
}
|
||||||
|
@ -409,6 +409,8 @@ void test_diff_workdir__head_index_and_workdir_all_differ(void)
|
|||||||
|
|
||||||
git_diff_list_free(diff_i2t);
|
git_diff_list_free(diff_i2t);
|
||||||
git_diff_list_free(diff_w2i);
|
git_diff_list_free(diff_w2i);
|
||||||
|
|
||||||
|
git_tree_free(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_diff_workdir__eof_newline_changes(void)
|
void test_diff_workdir__eof_newline_changes(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user