Commit de0555a347b4be48f80d0b3bf26ddd81f5ef38aa

Russell Belfer 2013-06-17T09:55:29

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.

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