Skip to content

Commit f4afcaa

Browse files
author
Vicent Marti
committed
Merge pull request libgit2#2209 from ethomson/cleanup
Cleanup some warnings and mem leaks
2 parents dc7efa1 + 9cb99e8 commit f4afcaa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/merge.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,9 +2629,8 @@ int git_merge(
26292629
on_error:
26302630
merge_state_cleanup(repo);
26312631

2632-
git_index_free(index_new);
2633-
26342632
done:
2633+
git_index_free(index_new);
26352634
git_index_free(index_repo);
26362635

26372636
git_tree_free(ancestor_tree);

tests/revwalk/hidecb.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,27 @@ void test_revwalk_hidecb__cleanup(void)
4848
/* Hide all commits */
4949
static int hide_every_commit_cb(const git_oid *commit_id, void *data)
5050
{
51+
GIT_UNUSED(commit_id);
52+
GIT_UNUSED(data);
53+
5154
return 1;
5255
}
5356

5457
/* Do not hide anything */
5558
static int hide_none_cb(const git_oid *commit_id, void *data)
5659
{
60+
GIT_UNUSED(commit_id);
61+
GIT_UNUSED(data);
62+
5763
return 0;
5864
}
5965

6066
/* Hide some commits */
6167
static int hide_commit_cb(const git_oid *commit_id, void *data)
6268
{
69+
GIT_UNUSED(commit_id);
70+
GIT_UNUSED(data);
71+
6372
if (0 == git_oid_cmp(commit_id, &commit_ids[5]))
6473
return 1;
6574
else

0 commit comments

Comments
 (0)