Fix potential leak of branch in is_git_repository

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-07-10 22:11:43 +02:00 committed by Dirk Hohndel
parent 1a8e8be3a9
commit f58bc011a7

View file

@ -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;
}