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
534cc5a3
Commit
534cc5a3
authored
Feb 09, 2016
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3603 from pks-t/pks/coverity-fixes
Coverity fixes
parents
ab87cb18
24b8ed2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
src/attr_file.c
+3
-2
src/checkout.c
+3
-1
src/pack-objects.c
+8
-4
src/pack.c
+0
-1
No files found.
src/attr_file.c
View file @
534cc5a3
...
...
@@ -123,7 +123,7 @@ int git_attr_file__load(
break
;
}
case
GIT_ATTR_FILE__FROM_FILE
:
{
int
fd
;
int
fd
=
-
1
;
/* For open or read errors, pretend that we got ENOTFOUND. */
/* TODO: issue warning when warning API is available */
...
...
@@ -133,7 +133,8 @@ int git_attr_file__load(
(
fd
=
git_futils_open_ro
(
entry
->
fullpath
))
<
0
||
(
error
=
git_futils_readbuffer_fd
(
&
content
,
fd
,
(
size_t
)
st
.
st_size
))
<
0
)
nonexistent
=
true
;
else
if
(
fd
>=
0
)
p_close
(
fd
);
break
;
...
...
src/checkout.c
View file @
534cc5a3
...
...
@@ -1487,8 +1487,10 @@ static int blob_content_to_file(
if
(
!
data
->
opts
.
disable_filters
&&
(
error
=
git_filter_list__load_ext
(
&
fl
,
data
->
repo
,
blob
,
hint_path
,
GIT_FILTER_TO_WORKTREE
,
&
filter_opts
)))
GIT_FILTER_TO_WORKTREE
,
&
filter_opts
)))
{
p_close
(
fd
);
return
error
;
}
/* setup the writer */
memset
(
&
writer
,
0
,
sizeof
(
struct
checkout_stream
));
...
...
src/pack-objects.c
View file @
534cc5a3
...
...
@@ -91,7 +91,7 @@ static unsigned name_hash(const char *name)
static
int
packbuilder_config
(
git_packbuilder
*
pb
)
{
git_config
*
config
;
int
ret
;
int
ret
=
0
;
int64_t
val
;
if
((
ret
=
git_repository_config_snapshot
(
&
config
,
pb
->
repo
))
<
0
)
...
...
@@ -100,8 +100,10 @@ static int packbuilder_config(git_packbuilder *pb)
#define config_get(KEY,DST,DFLT) do { \
ret = git_config_get_int64(&val, config, KEY); \
if (!ret) (DST) = val; \
else if (ret == GIT_ENOTFOUND) (DST) = (DFLT); \
else if (ret < 0) return -1; } while (0)
else if (ret == GIT_ENOTFOUND) { \
(DST) = (DFLT); \
ret = 0; \
} else if (ret < 0) goto out; } while (0)
config_get
(
"pack.deltaCacheSize"
,
pb
->
max_delta_cache_size
,
GIT_PACK_DELTA_CACHE_SIZE
);
...
...
@@ -113,9 +115,10 @@ static int packbuilder_config(git_packbuilder *pb)
#undef config_get
out
:
git_config_free
(
config
);
return
0
;
return
ret
;
}
int
git_packbuilder_new
(
git_packbuilder
**
out
,
git_repository
*
repo
)
...
...
@@ -605,6 +608,7 @@ static git_pobject **compute_write_order(git_packbuilder *pb)
}
if
(
wo_end
!=
pb
->
nr_objects
)
{
git__free
(
wo
);
giterr_set
(
GITERR_INVALID
,
"invalid write order"
);
return
NULL
;
}
...
...
src/pack.c
View file @
534cc5a3
...
...
@@ -790,7 +790,6 @@ int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p,
obj
->
zstream
.
next_out
=
Z_NULL
;
st
=
inflateInit
(
&
obj
->
zstream
);
if
(
st
!=
Z_OK
)
{
git__free
(
obj
);
giterr_set
(
GITERR_ZLIB
,
"failed to init packfile stream"
);
return
-
1
;
}
...
...
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