Commit adb58f7d646091f835d900867e22cb8329799dd2

Carlos Martín Nieto 2015-05-05T16:21:57

submodule: fix potential leak in the tests

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c
index d5e0236..2647e15 100644
--- a/tests/submodule/submodule_helpers.c
+++ b/tests/submodule/submodule_helpers.c
@@ -156,10 +156,9 @@ void refute__submodule_exists(
 	git_repository *repo, const char *name, int expected_error,
 	const char *msg, const char *file, int line)
 {
-	git_submodule *sm;
 	clar__assert_equal(
 		file, line, msg, 1, "%i",
-		expected_error, (int)(git_submodule_lookup(&sm, repo, name)));
+		expected_error, (int)(git_submodule_lookup(NULL, repo, name)));
 }
 
 unsigned int get_submodule_status(git_repository *repo, const char *name)