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
7026ad89
Commit
7026ad89
authored
May 16, 2013
by
Linquize
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calloc() to initialize memory
parent
12f831fa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
src/indexer.c
+2
-2
src/transports/smart_protocol.c
+1
-1
src/win32/dir.c
+1
-1
No files found.
src/indexer.c
View file @
7026ad89
...
...
@@ -259,7 +259,7 @@ static int store_object(git_indexer_stream *idx)
entry
=
git__calloc
(
1
,
sizeof
(
*
entry
));
GITERR_CHECK_ALLOC
(
entry
);
pentry
=
git__
malloc
(
sizeof
(
struct
git_pack_entry
));
pentry
=
git__
calloc
(
1
,
sizeof
(
struct
git_pack_entry
));
GITERR_CHECK_ALLOC
(
pentry
);
git_hash_final
(
&
oid
,
ctx
);
...
...
@@ -328,7 +328,7 @@ static int hash_and_save(git_indexer_stream *idx, git_rawobj *obj, git_off_t ent
return
-
1
;
}
pentry
=
git__
malloc
(
sizeof
(
struct
git_pack_entry
));
pentry
=
git__
calloc
(
1
,
sizeof
(
struct
git_pack_entry
));
GITERR_CHECK_ALLOC
(
pentry
);
git_oid_cpy
(
&
pentry
->
sha1
,
&
oid
);
...
...
src/transports/smart_protocol.c
View file @
7026ad89
...
...
@@ -576,7 +576,7 @@ static int add_push_report_pkt(git_push *push, git_pkt *pkt)
switch
(
pkt
->
type
)
{
case
GIT_PKT_OK
:
status
=
git__
malloc
(
sizeof
(
push_status
));
status
=
git__
calloc
(
1
,
sizeof
(
push_status
));
GITERR_CHECK_ALLOC
(
status
);
status
->
msg
=
NULL
;
status
->
ref
=
git__strdup
(((
git_pkt_ok
*
)
pkt
)
->
ref
);
...
...
src/win32/dir.c
View file @
7026ad89
...
...
@@ -32,7 +32,7 @@ git__DIR *git__opendir(const char *dir)
if
(
!
dir
||
!
init_filter
(
filter
,
sizeof
(
filter
),
dir
))
return
NULL
;
new
=
git__
malloc
(
sizeof
(
*
new
));
new
=
git__
calloc
(
1
,
sizeof
(
*
new
));
if
(
!
new
)
return
NULL
;
...
...
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