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
59d66af2
Commit
59d66af2
authored
Sep 05, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bdev: free after bdev_init
(Except in cases where we will immediately exit) Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
41c3b7c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
conf.c
src/lxc/conf.c
+3
-0
lxccontainer.c
src/lxc/lxccontainer.c
+2
-0
No files found.
src/lxc/conf.c
View file @
59d66af2
...
...
@@ -1264,9 +1264,12 @@ static int setup_rootfs(struct lxc_conf *conf)
// First try mounting rootfs using a bdev
struct
bdev
*
bdev
=
bdev_init
(
rootfs
->
path
,
rootfs
->
mount
,
NULL
);
if
(
bdev
&&
bdev
->
ops
->
mount
(
bdev
)
==
0
)
{
bdev_put
(
bdev
);
DEBUG
(
"mounted '%s' on '%s'"
,
rootfs
->
path
,
rootfs
->
mount
);
return
0
;
}
if
(
bdev
)
bdev_put
(
bdev
);
if
(
mount_rootfs
(
rootfs
->
path
,
rootfs
->
mount
))
{
ERROR
(
"failed to mount rootfs"
);
return
-
1
;
...
...
src/lxc/lxccontainer.c
View file @
59d66af2
...
...
@@ -1511,9 +1511,11 @@ static bool lxcapi_destroy(struct lxc_container *c)
r
=
bdev_init
(
c
->
lxc_conf
->
rootfs
.
path
,
c
->
lxc_conf
->
rootfs
.
mount
,
NULL
);
if
(
r
)
{
if
(
r
->
ops
->
destroy
(
r
)
<
0
)
{
bdev_put
(
r
);
ERROR
(
"Error destroying rootfs for %s"
,
c
->
name
);
goto
out
;
}
bdev_put
(
r
);
}
mod_all_rdeps
(
c
,
false
);
...
...
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