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:
authorPatrick Steinhardt <ps@pks.im>2016-03-11 11:07:29 +0300
committerPatrick Steinhardt <ps@pks.im>2016-03-11 11:07:42 +0300
commite756877dbff7b6b706820ce49744808c14941c32 (patch)
tree68cb9a3a80502f93109e919883fcb84ab793a306 /tests/index
parent2ba9a0ddacd315dafb54990ff2bfa204e6924016 (diff)
tests: nsec: correctly free nsec_path
git_buf_clear does not free allocated memory associated with a git_buf. Use `git_buf_free` instead to correctly free its memory and plug the memory leak.
Diffstat (limited to 'tests/index')
-rw-r--r--tests/index/nsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/index/nsec.c b/tests/index/nsec.c
index 326b19540..ea8a26743 100644
--- a/tests/index/nsec.c
+++ b/tests/index/nsec.c
@@ -56,7 +56,7 @@ static bool should_expect_nsecs(void)
p_unlink(nsec_path.ptr);
- git_buf_clear(&nsec_path);
+ git_buf_free(&nsec_path);
return expect;
}
@@ -89,7 +89,7 @@ void test_index_nsec__staging_maintains_other_nanos(void)
const git_index_entry *entry;
bool expect_nsec, test_file_has_nsec;
- expect_nsec = should_expect_nsecs();
+ expect_nsec = should_expect_nsecs();
test_file_has_nsec = try_create_file_with_nsec_timestamp("nsecs/a.txt");
cl_assert_equal_b(expect_nsec, test_file_has_nsec);