Fix memory leaks in diff rename tests This fixes a couple objects I forgot to free, and also updates the valgrind suppressions file on the Mac to cover a few more cases that had crept in.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/tests-clar/diff/rename.c b/tests-clar/diff/rename.c
index 8a08da3..2600bd8 100644
--- a/tests-clar/diff/rename.c
+++ b/tests-clar/diff/rename.c
@@ -947,6 +947,7 @@ void test_diff_rename__case_changes_are_split(void)
git_diff_list_free(diff);
git_index_free(index);
+ git_tree_free(tree);
}
void test_diff_rename__unmodified_can_be_renamed(void)
@@ -993,4 +994,6 @@ void test_diff_rename__unmodified_can_be_renamed(void)
cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]);
git_diff_list_free(diff);
+ git_index_free(index);
+ git_tree_free(tree);
}
diff --git a/tests-clar/valgrind-supp-mac.txt b/tests-clar/valgrind-supp-mac.txt
index 297b11e..fcc7ede 100644
--- a/tests-clar/valgrind-supp-mac.txt
+++ b/tests-clar/valgrind-supp-mac.txt
@@ -113,24 +113,18 @@
{
mac-ssl-leak-1
Memcheck:Leak
- fun:malloc
- fun:CRYPTO_malloc
...
fun:ERR_load_strings
}
{
mac-ssl-leak-2
Memcheck:Leak
- fun:malloc
- fun:CRYPTO_malloc
...
fun:SSL_library_init
}
{
mac-ssl-leak-3
Memcheck:Leak
- fun:malloc
- fun:strdup
...
fun:si_module_with_name
fun:getaddrinfo
@@ -144,6 +138,14 @@
fun:ssl3_get_server_certificate
}
{
+ mac-ssl-leak-5
+ Memcheck:Leak
+ fun:malloc
+ fun:CRYPTO_malloc
+ ...
+ fun:ERR_put_error
+}
+{
clar-printf-buf
Memcheck:Leak
fun:malloc