Initialize a few variables

Coverity complains about the git_rawobj ones because we use a loop in
which we keep remembering the old version, and we end up copying our
object as the base, so we want to have the data pointer be NULL.
This commit is contained in:
Carlos Martín Nieto 2015-06-09 16:53:07 +02:00
parent 81be2f467c
commit 02980bdca1
3 changed files with 3 additions and 3 deletions

View File

@ -822,7 +822,7 @@ static int resolve_deltas(git_indexer *idx, git_transfer_progress *stats)
progressed = 0;
non_null = 0;
git_vector_foreach(&idx->deltas, i, delta) {
git_rawobj obj;
git_rawobj obj = {NULL};
if (!delta)
continue;

View File

@ -383,7 +383,7 @@ static int pack_backend__read_internal(
git_odb_backend *backend, const git_oid *oid)
{
struct git_pack_entry e;
git_rawobj raw;
git_rawobj raw = {NULL};
int error;
if ((error = pack_entry_find(&e, (struct pack_backend *)backend, oid)) < 0 ||

View File

@ -512,7 +512,7 @@ static int rebase_ensure_not_dirty(
git_tree *head = NULL;
git_index *index = NULL;
git_diff *diff = NULL;
int error;
int error = 0;
if (check_index) {
if ((error = git_repository_head_tree(&head, repo)) < 0 ||