Skip to content

Commit 73427b9

Browse files
authored
Merge pull request libgit2#5142 from scottfurry/StaticChkFixExamples
Resolve static check warnings in example code
2 parents e9102de + 2ba7dbb commit 73427b9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,5 @@ static void parse_opts(struct opts *o, int argc, char *argv[])
244244
}
245245

246246
if (!o->dir)
247-
usage("must specify directory to init", NULL);
247+
usage("must specify directory to init", "");
248248
}

examples/merge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, merge_opt
220220
check_lg2(git_repository_head(&head_ref, repo), "failed to get repo HEAD", NULL);
221221
if (resolve_refish(&merge_commit, repo, opts->heads[0])) {
222222
fprintf(stderr, "failed to resolve refish %s", opts->heads[0]);
223+
free(parents);
223224
return -1;
224225
}
225226

0 commit comments

Comments
 (0)