Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
aca2d26a
Commit
aca2d26a
authored
May 09, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1566 from ethomson/ref_zero
calloc refs instead of malloc'ing them
parents
9ca4ff41
617bb175
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/refdb_fs.c
+2
-2
No files found.
src/refdb_fs.c
View file @
aca2d26a
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment