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
90912571
Unverified
Commit
90912571
authored
Apr 14, 2019
by
Stéphane Graber
Committed by
GitHub
Apr 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2937 from brauner/2019-04-14/issue_2912
storage: prevent unitialized variable warning
parents
49ce8186
240a130f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
btrfs.c
src/lxc/storage/btrfs.c
+3
-8
No files found.
src/lxc/storage/btrfs.c
View file @
90912571
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include "btrfs.h"
#include "btrfs.h"
#include "config.h"
#include "config.h"
#include "log.h"
#include "log.h"
#include "memory_utils.h"
#include "rsync.h"
#include "rsync.h"
#include "storage.h"
#include "storage.h"
#include "utils.h"
#include "utils.h"
...
@@ -763,7 +764,6 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -763,7 +764,6 @@ static int btrfs_recursive_destroy(const char *path)
int
ret
,
e
,
i
;
int
ret
,
e
,
i
;
unsigned
long
off
=
0
;
unsigned
long
off
=
0
;
u16
name_len
;
u16
name_len
;
char
*
tmppath
;
u64
dir_id
;
u64
dir_id
;
fd
=
open
(
path
,
O_RDONLY
);
fd
=
open
(
path
,
O_RDONLY
);
...
@@ -834,7 +834,8 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -834,7 +834,8 @@ static int btrfs_recursive_destroy(const char *path)
* name of the child subvol in question.
* name of the child subvol in question.
*/
*/
if
(
sh
.
objectid
!=
root_id
&&
sh
.
type
==
BTRFS_ROOT_BACKREF_KEY
)
{
if
(
sh
.
objectid
!=
root_id
&&
sh
.
type
==
BTRFS_ROOT_BACKREF_KEY
)
{
char
*
name
,
*
tmp
;
__do_free
char
*
name
=
NULL
,
*
tmppath
=
NULL
;
char
*
tmp
;
ref
=
(
struct
btrfs_root_ref
*
)(
args
.
buf
+
off
);
ref
=
(
struct
btrfs_root_ref
*
)(
args
.
buf
+
off
);
name_len
=
btrfs_stack_root_ref_name_len
(
ref
);
name_len
=
btrfs_stack_root_ref_name_len
(
ref
);
...
@@ -844,7 +845,6 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -844,7 +845,6 @@ static int btrfs_recursive_destroy(const char *path)
if
(
!
name
)
{
if
(
!
name
)
{
ERROR
(
"Out of memory"
);
ERROR
(
"Out of memory"
);
free_btrfs_tree
(
tree
);
free_btrfs_tree
(
tree
);
free
(
tmppath
);
close
(
fd
);
close
(
fd
);
}
}
...
@@ -859,14 +859,9 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -859,14 +859,9 @@ static int btrfs_recursive_destroy(const char *path)
name_len
,
tmppath
))
{
name_len
,
tmppath
))
{
ERROR
(
"Out of memory"
);
ERROR
(
"Out of memory"
);
free_btrfs_tree
(
tree
);
free_btrfs_tree
(
tree
);
free
(
name
);
free
(
tmppath
);
close
(
fd
);
close
(
fd
);
return
-
1
;
return
-
1
;
}
}
free
(
tmppath
);
free
(
name
);
}
}
off
+=
sh
.
len
;
off
+=
sh
.
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