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
266892a9
Unverified
Commit
266892a9
authored
Jan 17, 2019
by
t00416110
Committed by
Christian Brauner
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf.c: fix memory leak and mount error
1. cleanup namespace memory 2. fix bug when ro mount not setted, mount propagation will be skipped. Signed-off-by:
t00416110
<
tanyifeng1@huawei.com
>
parent
69be5eab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
conf.c
src/lxc/conf.c
+14
-4
No files found.
src/lxc/conf.c
View file @
266892a9
...
@@ -2079,6 +2079,9 @@ static int mount_entry(const char *fsname, const char *target,
...
@@ -2079,6 +2079,9 @@ static int mount_entry(const char *fsname, const char *target,
}
}
}
}
#ifdef HAVE_STATVFS
skipremount:
#endif
if
(
pflags
)
{
if
(
pflags
)
{
ret
=
mount
(
NULL
,
target
,
NULL
,
pflags
,
NULL
);
ret
=
mount
(
NULL
,
target
,
NULL
,
pflags
,
NULL
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
@@ -2095,10 +2098,6 @@ static int mount_entry(const char *fsname, const char *target,
...
@@ -2095,10 +2098,6 @@ static int mount_entry(const char *fsname, const char *target,
DEBUG
(
"Changed mount propagation for
\"
%s
\"
"
,
target
);
DEBUG
(
"Changed mount propagation for
\"
%s
\"
"
,
target
);
}
}
#ifdef HAVE_STATVFS
skipremount:
#endif
DEBUG
(
"Mounted
\"
%s
\"
on
\"
%s
\"
with filesystem type
\"
%s
\"
"
,
DEBUG
(
"Mounted
\"
%s
\"
on
\"
%s
\"
with filesystem type
\"
%s
\"
"
,
srcpath
?
srcpath
:
"(null)"
,
target
,
fstype
);
srcpath
?
srcpath
:
"(null)"
,
target
,
fstype
);
...
@@ -3781,6 +3780,16 @@ int lxc_clear_config_keepcaps(struct lxc_conf *c)
...
@@ -3781,6 +3780,16 @@ int lxc_clear_config_keepcaps(struct lxc_conf *c)
return
0
;
return
0
;
}
}
int
lxc_clear_namespace
(
struct
lxc_conf
*
c
)
{
int
i
;
for
(
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
{
free
(
c
->
ns_share
[
i
]);
c
->
ns_share
[
i
]
=
NULL
;
}
return
0
;
}
int
lxc_clear_cgroups
(
struct
lxc_conf
*
c
,
const
char
*
key
,
int
version
)
int
lxc_clear_cgroups
(
struct
lxc_conf
*
c
,
const
char
*
key
,
int
version
)
{
{
char
*
global_token
,
*
namespaced_token
;
char
*
global_token
,
*
namespaced_token
;
...
@@ -4058,6 +4067,7 @@ void lxc_conf_free(struct lxc_conf *conf)
...
@@ -4058,6 +4067,7 @@ void lxc_conf_free(struct lxc_conf *conf)
lxc_clear_limits
(
conf
,
"lxc.prlimit"
);
lxc_clear_limits
(
conf
,
"lxc.prlimit"
);
lxc_clear_sysctls
(
conf
,
"lxc.sysctl"
);
lxc_clear_sysctls
(
conf
,
"lxc.sysctl"
);
lxc_clear_procs
(
conf
,
"lxc.proc"
);
lxc_clear_procs
(
conf
,
"lxc.proc"
);
lxc_clear_namespace
(
conf
);
free
(
conf
->
cgroup_meta
.
dir
);
free
(
conf
->
cgroup_meta
.
dir
);
free
(
conf
->
cgroup_meta
.
controllers
);
free
(
conf
->
cgroup_meta
.
controllers
);
free
(
conf
);
free
(
conf
);
...
...
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