We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ca4ff4 commit 617bb17Copy full SHA for 617bb17
src/refdb_fs.c
@@ -106,7 +106,7 @@ static int packed_parse_oid(
106
107
refname_len = refname_end - refname_begin;
108
109
- ref = git__malloc(sizeof(struct packref) + refname_len + 1);
+ ref = git__calloc(1, sizeof(struct packref) + refname_len + 1);
110
GITERR_CHECK_ALLOC(ref);
111
112
memcpy(ref->name, refname_begin, refname_len);
@@ -316,7 +316,7 @@ static int loose_lookup_to_packfile(
316
git_buf_rtrim(&ref_file);
317
318
name_len = strlen(name);
319
- ref = git__malloc(sizeof(struct packref) + name_len + 1);
+ ref = git__calloc(1, sizeof(struct packref) + name_len + 1);
320
321
322
memcpy(ref->name, name, name_len);
0 commit comments