Skip to content

Commit 9a19310

Browse files
authored
Merge pull request libgit2#4774 from tiennou/fix/clang-analyzer
Coverity flavored clang analyzer fixes
2 parents fd7ab1d + 1c949ce commit 9a19310

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/mailmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int git_mailmap_add_entry(
225225

226226
static int mailmap_add_buffer(git_mailmap *mm, const char *buf, size_t len)
227227
{
228-
int error;
228+
int error = 0;
229229
git_parse_ctx ctx;
230230

231231
/* Scratch buffers containing the real parsed names & emails */

src/remote.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int get_optional_config(
428428

429429
int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
430430
{
431-
git_remote *remote;
431+
git_remote *remote = NULL;
432432
git_buf buf = GIT_BUF_INIT;
433433
const char *val;
434434
int error = 0;
@@ -510,7 +510,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
510510
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0)
511511
goto cleanup;
512512

513-
if (download_tags_value(remote, config) < 0)
513+
if ((error = download_tags_value(remote, config)) < 0)
514514
goto cleanup;
515515

516516
if ((error = lookup_remote_prune_config(remote, config, name)) < 0)

src/revwalk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static int sort_in_topological_order(git_commit_list **out, git_revwalk *walk, g
550550

551551
static int prepare_walk(git_revwalk *walk)
552552
{
553-
int error;
553+
int error = 0;
554554
git_commit_list *list, *commits = NULL;
555555
git_commit_list_node *next;
556556

src/transports/http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int auth_context_match(
142142
}
143143

144144
if (!scheme)
145-
return 0;
145+
return -1;
146146

147147
/* See if authentication has already started for this scheme */
148148
git_vector_foreach(&t->auth_contexts, i, c) {

0 commit comments

Comments
 (0)