Commit 7cae2bcdf973c1b1eea8e139a6fd8de3b47f46ab

Ben Straub 2012-07-21T20:11:37

filter: fix memory leak

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/filter.c b/src/filter.c
index ecdc809..e9517a2 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -171,7 +171,10 @@ static int unfiltered_blob_contents(git_buf *out, git_repository *repo, const gi
 	git_blob *blob;
 
 	if (!(retcode = git_blob_lookup(&blob, repo, blob_id)))
+	{
 		retcode = git_blob__getbuf(out, blob);
+		git_blob_free(blob);
+	}
 
 	return retcode;
 }