Commit ab4bcc038aebb68975935809cd328fc9ccb70ba7

Ben Straub 2014-01-22T14:14:37

Plug a small memory leak

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/checkout.c b/src/checkout.c
index 9629290..6769cbc 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -753,8 +753,11 @@ static int checkout_conflicts_load(checkout_data *data, git_iterator *workdir, g
 		conflict->theirs = theirs;
 
 		if ((error = checkout_conflict_detect_submodule(conflict)) < 0 ||
-			(error = checkout_conflict_detect_binary(data->repo, conflict)) < 0)
+		    (error = checkout_conflict_detect_binary(data->repo, conflict)) < 0)
+		{
+			git__free(conflict);
 			goto done;
+		}
 
 		git_vector_insert(&data->conflicts, conflict);
 	}