diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2012-11-13 20:06:15 -0800 |
---|---|---|
committer | Carlos Martín Nieto <cmn@elego.de> | 2012-11-13 20:06:15 -0800 |
commit | 7e9f5e650016d7dce9d5cfd433e053c7126f7edf (patch) | |
tree | 6e2ef95e163ed48a97c849656207e8e175d35f63 | |
parent | 6132a54e0b4b3c5c9b03c0eba191bb756738d34a (diff) | |
download | libgit2-7e9f5e650016d7dce9d5cfd433e053c7126f7edf.tar.gz |
Slightly different valgrind fix
Allocate with calloc rather than conditionally memsetting a specific
part of the struct later on.
-rw-r--r-- | src/transports/local.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/transports/local.c b/src/transports/local.c index 587b55ba8..46c9218c7 100644 --- a/src/transports/local.c +++ b/src/transports/local.c @@ -77,7 +77,7 @@ static int add_ref(transport_local *t, const char *name) } /* And if it's a tag, peel it, and add it to the list */ - head = (git_remote_head *)git__malloc(sizeof(git_remote_head)); + head = (git_remote_head *)git__calloc(1, sizeof(git_remote_head)); GITERR_CHECK_ALLOC(head); if (git_buf_join(&buf, 0, name, peeled) < 0) return -1; @@ -227,8 +227,6 @@ static int local_negotiate_fetch( git_oid_cpy(&rhead->loid, git_object_id(obj)); else if (error != GIT_ENOTFOUND) return error; - else - memset(&rhead->loid, 0, sizeof(git_oid)); git_object_free(obj); giterr_clear(); } |