Commit 617bb175 by Edward Thomson

calloc refs instead of malloc'ing them

parent 9ca4ff41
...@@ -106,7 +106,7 @@ static int packed_parse_oid( ...@@ -106,7 +106,7 @@ static int packed_parse_oid(
refname_len = refname_end - refname_begin; refname_len = refname_end - refname_begin;
ref = git__malloc(sizeof(struct packref) + refname_len + 1); ref = git__calloc(1, sizeof(struct packref) + refname_len + 1);
GITERR_CHECK_ALLOC(ref); GITERR_CHECK_ALLOC(ref);
memcpy(ref->name, refname_begin, refname_len); memcpy(ref->name, refname_begin, refname_len);
...@@ -316,7 +316,7 @@ static int loose_lookup_to_packfile( ...@@ -316,7 +316,7 @@ static int loose_lookup_to_packfile(
git_buf_rtrim(&ref_file); git_buf_rtrim(&ref_file);
name_len = strlen(name); name_len = strlen(name);
ref = git__malloc(sizeof(struct packref) + name_len + 1); ref = git__calloc(1, sizeof(struct packref) + name_len + 1);
GITERR_CHECK_ALLOC(ref); GITERR_CHECK_ALLOC(ref);
memcpy(ref->name, name, name_len); memcpy(ref->name, name, name_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment