Merge pull request #2209 from ethomson/cleanup Cleanup some warnings and mem leaks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/src/merge.c b/src/merge.c
index 42fbd79..24b7d37 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2629,9 +2629,8 @@ int git_merge(
on_error:
merge_state_cleanup(repo);
- git_index_free(index_new);
-
done:
+ git_index_free(index_new);
git_index_free(index_repo);
git_tree_free(ancestor_tree);
diff --git a/tests/revwalk/hidecb.c b/tests/revwalk/hidecb.c
index c13a177..26ff183 100644
--- a/tests/revwalk/hidecb.c
+++ b/tests/revwalk/hidecb.c
@@ -48,18 +48,27 @@ void test_revwalk_hidecb__cleanup(void)
/* Hide all commits */
static int hide_every_commit_cb(const git_oid *commit_id, void *data)
{
+ GIT_UNUSED(commit_id);
+ GIT_UNUSED(data);
+
return 1;
}
/* Do not hide anything */
static int hide_none_cb(const git_oid *commit_id, void *data)
{
+ GIT_UNUSED(commit_id);
+ GIT_UNUSED(data);
+
return 0;
}
/* Hide some commits */
static int hide_commit_cb(const git_oid *commit_id, void *data)
{
+ GIT_UNUSED(commit_id);
+ GIT_UNUSED(data);
+
if (0 == git_oid_cmp(commit_id, &commit_ids[5]))
return 1;
else