Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
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
Chen Yisong
lxc
Commits
76c00d39
Unverified
Commit
76c00d39
authored
Jun 14, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425767
Unchecked return value Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
7eab8fc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
btrfs.c
src/lxc/storage/btrfs.c
+6
-2
No files found.
src/lxc/storage/btrfs.c
View file @
76c00d39
...
@@ -659,7 +659,7 @@ static void free_btrfs_tree(struct my_btrfs_tree *tree)
...
@@ -659,7 +659,7 @@ static void free_btrfs_tree(struct my_btrfs_tree *tree)
static
bool
do_remove_btrfs_children
(
struct
my_btrfs_tree
*
tree
,
u64
root_id
,
static
bool
do_remove_btrfs_children
(
struct
my_btrfs_tree
*
tree
,
u64
root_id
,
const
char
*
path
)
const
char
*
path
)
{
{
int
i
;
int
i
,
ret
;
char
*
newpath
;
char
*
newpath
;
size_t
len
;
size_t
len
;
...
@@ -675,7 +675,11 @@ static bool do_remove_btrfs_children(struct my_btrfs_tree *tree, u64 root_id,
...
@@ -675,7 +675,11 @@ static bool do_remove_btrfs_children(struct my_btrfs_tree *tree, u64 root_id,
ERROR
(
"Out of memory"
);
ERROR
(
"Out of memory"
);
return
false
;
return
false
;
}
}
snprintf
(
newpath
,
len
,
"%s/%s"
,
path
,
tree
->
nodes
[
i
].
dirname
);
ret
=
snprintf
(
newpath
,
len
,
"%s/%s"
,
path
,
tree
->
nodes
[
i
].
dirname
);
if
(
ret
<
0
||
ret
>=
len
)
{
free
(
newpath
);
return
false
;
}
if
(
!
do_remove_btrfs_children
(
tree
,
tree
->
nodes
[
i
].
objid
,
newpath
))
{
if
(
!
do_remove_btrfs_children
(
tree
,
tree
->
nodes
[
i
].
objid
,
newpath
))
{
ERROR
(
"Failed to prune %s
\n
"
,
tree
->
nodes
[
i
].
name
);
ERROR
(
"Failed to prune %s
\n
"
,
tree
->
nodes
[
i
].
name
);
free
(
newpath
);
free
(
newpath
);
...
...
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