Merge pull request #2408 from phkelley/win32_test_fixes

Win32 test fixes
diff --git a/tests/online/clone.c b/tests/online/clone.c
index e269771..8a2a64f 100644
--- a/tests/online/clone.c
+++ b/tests/online/clone.c
@@ -194,6 +194,9 @@
 	git_remote_free(remote);
 	git_reference_free(head);
 	git_buf_free(&path);
+	git_repository_free(g_repo);
+	g_repo = NULL;
+
 	cl_fixture_cleanup("./foo.git");
 }
 
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c
index 50aa975..c6d04b4 100644
--- a/tests/submodule/submodule_helpers.c
+++ b/tests/submodule/submodule_helpers.c
@@ -19,8 +19,8 @@
 	cl_git_pass(git_buf_joinpath(&in_f, workdir, "gitmodules"));
 	cl_git_pass(git_buf_joinpath(&out_f, workdir, ".gitmodules"));
 
-	cl_assert((in  = fopen(in_f.ptr, "r")) != NULL);
-	cl_assert((out = fopen(out_f.ptr, "w")) != NULL);
+	cl_assert((in  = fopen(in_f.ptr, "rb")) != NULL);
+	cl_assert((out = fopen(out_f.ptr, "wb")) != NULL);
 
 	while (fgets(line, sizeof(line), in) != NULL) {
 		char *scan = line;