Commit 146f5c75d73229cc0d6a4fcebf5d81f90d54b1d3

Carlos Martín Nieto 2012-04-14T15:09:29

repo: plug a couple of leaks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/repository.c b/src/repository.c
index 413bb17..18881ec 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -301,6 +301,8 @@ static int find_repo(
 				if (!(error = read_gitfile(&repo_link, path.ptr))) {
 					if (valid_repository_path(&repo_link))
 						git_buf_swap(repo_path, &repo_link);
+
+					git_buf_free(&repo_link);
 					break;
 				}
 				git_buf_free(&repo_link);
@@ -376,6 +378,7 @@ int git_repository_open_ext(
 		return error;
 	}
 
+	git_buf_free(&parent);
 	*repo_ptr = repo;
 	return 0;
 }