Commit cc845595f00808a12044aaf7446c10df3c96f8f7

Etienne Samson 2018-01-17T02:25:36

examples: fix remaining review comments

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/examples/merge.c b/examples/merge.c
index 15df7d0..206a8c4 100644
--- a/examples/merge.c
+++ b/examples/merge.c
@@ -244,6 +244,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, merge_opt
 	check_lg2(git_repository_head(&head_ref, repo), "failed to get repo HEAD", NULL);
 	if (resolve_refish(&merge_commit, repo, opts->heads[0])) {
 		fprintf(stderr, "failed to resolve refish %s", opts->heads[0]);
+		return -1;
 	}
 
 	/* Maybe that's a ref, so DWIM it */
@@ -293,6 +294,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, merge_opt
 	git_repository_state_cleanup(repo);
 
 cleanup:
+	free(parents);
 	return err;
 }