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
e052e6d0
Unverified
Commit
e052e6d0
authored
Apr 15, 2020
by
Christian Brauner
Committed by
Stéphane Graber
Apr 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: don't double free in get_minimal_idmap()
Fixes: Coverity 1461725. Fixes: Coverity 1461727. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6a40ccf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
conf.c
src/lxc/conf.c
+4
-4
No files found.
src/lxc/conf.c
View file @
e052e6d0
...
...
@@ -3951,7 +3951,7 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
euid
=
geteuid
();
if
(
euid
>=
container_root_uid
->
hostid
&&
euid
<
(
container_root_uid
->
hostid
+
container_root_uid
->
range
))
host_uid_map
=
container_root_uid
;
host_uid_map
=
move_ptr
(
container_root_uid
)
;
container_root_gid
=
mapped_nsid_add
(
conf
,
nsgid
,
ID_TYPE_GID
);
if
(
!
container_root_gid
)
...
...
@@ -3959,7 +3959,7 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
egid
=
getegid
();
if
(
egid
>=
container_root_gid
->
hostid
&&
egid
<
(
container_root_gid
->
hostid
+
container_root_gid
->
range
))
host_gid_map
=
container_root_gid
;
host_gid_map
=
move_ptr
(
container_root_gid
)
;
/* Check whether the {g,u}id of the user has a mapping. */
if
(
!
host_uid_map
)
...
...
@@ -3985,7 +3985,7 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
lxc_list_add_elem
(
tmplist
,
container_root_uid
);
lxc_list_add_tail
(
idmap
,
tmplist
);
if
(
host_uid_map
!=
container_root_uid
)
{
if
(
container_root_uid
)
{
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_uid
);
...
...
@@ -4007,7 +4007,7 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
lxc_list_add_elem
(
tmplist
,
container_root_gid
);
lxc_list_add_tail
(
idmap
,
tmplist
);
if
(
host_gid_map
!=
container_root_gid
)
{
if
(
container_root_gid
)
{
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_gid
);
...
...
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