Merge pull request #1065 from nulltoken/fix/memory-leak

Fix memory leaks
This commit is contained in:
Ben Straub 2012-11-13 05:45:08 -08:00
commit e45423dd2c
2 changed files with 3 additions and 0 deletions

View File

@ -227,6 +227,7 @@ static int local_negotiate_fetch(
git_oid_cpy(&rhead->loid, git_object_id(obj));
else if (error != GIT_ENOTFOUND)
return error;
git_object_free(obj);
giterr_clear();
}

View File

@ -52,6 +52,8 @@ void test_network_fetchlocal__partial(void)
cl_git_pass(git_remote_download(origin, transfer_cb, &callcount));
cl_git_pass(git_remote_update_tips(origin));
git_strarray_free(&refnames);
cl_git_pass(git_reference_list(&refnames, repo, GIT_REF_LISTALL));
cl_assert_equal_i(19, refnames.count); /* 18 remote + 1 local */
cl_assert(callcount > 0);