Commit c19bc93cef62cf4a638ab42ba9562885b07a68ce

Russell Belfer 2012-02-29T14:19:39

Fixing memory leaks indicated by valgrind This clears up the memory leaks that valgrind seems to find on my machine.

diff --git a/src/path.c b/src/path.c
index ceae2ab..d2c292b 100644
--- a/src/path.c
+++ b/src/path.c
@@ -624,5 +624,7 @@ int git_path_dirload_with_stat(
 		}
 	}
 
+	git_buf_free(&full);
+
 	return error;
 }
diff --git a/tests-clar/config/multivar.c b/tests-clar/config/multivar.c
index a8451ac..9a411f0 100644
--- a/tests-clar/config/multivar.c
+++ b/tests-clar/config/multivar.c
@@ -123,6 +123,8 @@ void test_config_multivar__replace(void)
 	n = 0;
 	cl_git_pass(git_config_get_multivar(cfg, _name, NULL, cb, &n));
 	cl_assert(n == 2);
+
+	git_config_free(cfg);
 }
 
 void test_config_multivar__replace_multiple(void)
@@ -145,4 +147,5 @@ void test_config_multivar__replace_multiple(void)
 	cl_git_pass(git_config_get_multivar(cfg, _name, "otherplace", cb, &n));
 	cl_assert(n == 2);
 
+	git_config_free(cfg);
 }
diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c
index 28cfa23..9fefdbb 100644
--- a/tests-clar/diff/workdir.c
+++ b/tests-clar/diff/workdir.c
@@ -158,6 +158,8 @@ void test_diff_workdir__to_tree(void)
 	cl_assert(exp.line_adds == 12);
 	cl_assert(exp.line_dels == 4);
 
+	git_diff_list_free(diff);
+
 	git_tree_free(a);
 	git_tree_free(b);
 }