summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-06-20 00:46:26 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-06-20 00:46:34 +0200
commitcdca82c7842ade2074f37be22f2251d6a9040a9d (patch)
treeb2b59d514f99f66bcd9733ee9026cbf4942ed9eb
parentc3ce8d0c9a8c9510e713babf1110b2df84f0aa88 (diff)
downloadlibgit2-cdca82c7842ade2074f37be22f2251d6a9040a9d.tar.gz
Plug a few leaks
-rw-r--r--src/revparse.c2
-rw-r--r--tests-clar/core/env.c2
-rw-r--r--tests-clar/diff/workdir.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 1f0e7da34..c275b55a6 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -552,6 +552,7 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo,
if (!entry) {
giterr_set(GITERR_INVALID, "Invalid tree path '%s'", path);
+ git__free(alloc);
return GIT_ERROR;
}
@@ -622,6 +623,7 @@ static int revparse_global_grep(git_object **out, git_repository *repo, const ch
}
if (!resultobj) {
giterr_set(GITERR_REFERENCE, "Couldn't find a match for %s", pattern);
+ git_object_free(walkobj);
} else {
*out = resultobj;
}
diff --git a/tests-clar/core/env.c b/tests-clar/core/env.c
index 9361341eb..a2a65be72 100644
--- a/tests-clar/core/env.c
+++ b/tests-clar/core/env.c
@@ -112,4 +112,6 @@ void test_core_env__1(void)
cl_assert(git_futils_find_system_file(&path, "nonexistentfile") == -1);
#endif
+
+ git_buf_free(&path);
}
diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c
index 0c17eeb4a..801439e30 100644
--- a/tests-clar/diff/workdir.c
+++ b/tests-clar/diff/workdir.c
@@ -409,6 +409,8 @@ void test_diff_workdir__head_index_and_workdir_all_differ(void)
git_diff_list_free(diff_i2t);
git_diff_list_free(diff_w2i);
+
+ git_tree_free(tree);
}
void test_diff_workdir__eof_newline_changes(void)