[PATCH 2/5] Fix potential leak of branch in is_git_repository

Anton Lundin glance at acc.umu.se
Thu Jul 10 13:11:43 PDT 2014


Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 save-git.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/save-git.c b/save-git.c
index 0ba6e98..a1ef022 100644
--- a/save-git.c
+++ b/save-git.c
@@ -1093,6 +1093,7 @@ struct git_repository *is_git_repository(const char *filename, const char **bran
 
 	if (stat(loc, &st) < 0 || !S_ISDIR(st.st_mode)) {
 		free(loc);
+		free(branch);
 		return dummy_git_repository;
 	}
 
-- 
1.9.1



More information about the subsurface mailing list