Commit 1ad15540e42d7f1fb209fdb568afa2aa03388ff6

Pierre-Olivier Latour 2014-10-24T08:23:14

Fixed memory leak in git_tag_delete()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/tag.c b/src/tag.c
index d7b531d..ca2ed53 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -406,8 +406,9 @@ int git_tag_delete(git_repository *repo, const char *tag_name)
 	if (error < 0)
 		return error;
 
-	if ((error = git_reference_delete(tag_ref)) == 0)
-		git_reference_free(tag_ref);
+	error = git_reference_delete(tag_ref);
+
+	git_reference_free(tag_ref);
 
 	return error;
 }