Merge pull request #1725 from libgit2/ntk/fix/leaks

Plug some memory leaks
This commit is contained in:
Vicent Martí 2013-07-13 06:18:24 -07:00
commit 1662158cf9
2 changed files with 3 additions and 1 deletions

View File

@ -798,7 +798,7 @@ static void submodule_update_from_head_data(
static int submodule_update_head(git_submodule *submodule)
{
git_tree *head = NULL;
git_tree_entry *te;
git_tree_entry *te = NULL;
submodule->flags = submodule->flags &
~(GIT_SUBMODULE_STATUS_IN_HEAD |
@ -811,6 +811,7 @@ static int submodule_update_head(git_submodule *submodule)
else
submodule_update_from_head_data(submodule, te->attr, &te->oid);
git_tree_entry_free(te);
git_tree_free(head);
return 0;
}

View File

@ -89,4 +89,5 @@ void test_diff_pathspec__0(void)
git_tree_free(a);
git_tree_free(b);
git_pathspec_free(ps);
}