Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-07-13 15:55:03 +0400
committernulltoken <emeric.fermas@gmail.com>2013-07-13 16:14:40 +0400
commitb3a559ddce5e23d7084546ca771fc16e96d24ed8 (patch)
tree4946ed1e1267398ed9aaadeaa33ef8d6e2bc2623 /src/submodule.c
parent3a025b97ffdf5f5f633d6d6d9b13f0974fa8052f (diff)
submodule: Fix memory leaks
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c
index b5dacc42e..b4e917561 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -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;
}