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
2c6e8985
Unverified
Commit
2c6e8985
authored
Apr 15, 2020
by
Stéphane Graber
Committed by
GitHub
Apr 15, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3382 from brauner/2020-04-15/fixes
conf: correctly cleanup memory in get_minimal_idmap()
parents
55785a2c
47649d5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
conf.c
src/lxc/conf.c
+8
-18
No files found.
src/lxc/conf.c
View file @
2c6e8985
...
@@ -3985,45 +3985,35 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
...
@@ -3985,45 +3985,35 @@ static struct lxc_list *get_minimal_idmap(const struct lxc_conf *conf,
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
if
(
!
tmplist
)
if
(
!
tmplist
)
return
NULL
;
return
NULL
;
lxc_list_add_elem
(
tmplist
,
container_root_uid
);
/* idmap will now keep track of that memory. */
lxc_list_add_elem
(
tmplist
,
move_ptr
(
host_uid_map
));
lxc_list_add_tail
(
idmap
,
tmplist
);
lxc_list_add_tail
(
idmap
,
tmplist
);
if
(
container_root_uid
)
{
if
(
container_root_uid
)
{
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_uid
);
/* Add container root to the map. */
/* Add container root to the map. */
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
if
(
!
tmplist
)
if
(
!
tmplist
)
return
NULL
;
return
NULL
;
lxc_list_add_elem
(
tmplist
,
host_uid_map
);
/* idmap will now keep track of that memory. */
lxc_list_add_elem
(
tmplist
,
move_ptr
(
container_root_uid
));
lxc_list_add_tail
(
idmap
,
tmplist
);
lxc_list_add_tail
(
idmap
,
tmplist
);
}
}
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_uid
);
/* idmap will now keep track of that memory. */
move_ptr
(
host_uid_map
);
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
if
(
!
tmplist
)
if
(
!
tmplist
)
return
NULL
;
return
NULL
;
lxc_list_add_elem
(
tmplist
,
container_root_gid
);
/* idmap will now keep track of that memory. */
lxc_list_add_elem
(
tmplist
,
move_ptr
(
host_gid_map
));
lxc_list_add_tail
(
idmap
,
tmplist
);
lxc_list_add_tail
(
idmap
,
tmplist
);
if
(
container_root_gid
)
{
if
(
container_root_gid
)
{
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_gid
);
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
tmplist
=
malloc
(
sizeof
(
*
tmplist
));
if
(
!
tmplist
)
if
(
!
tmplist
)
return
NULL
;
return
NULL
;
lxc_list_add_elem
(
tmplist
,
host_gid_map
);
/* idmap will now keep track of that memory. */
lxc_list_add_elem
(
tmplist
,
move_ptr
(
container_root_gid
));
lxc_list_add_tail
(
idmap
,
tmplist
);
lxc_list_add_tail
(
idmap
,
tmplist
);
}
}
/* idmap will now keep track of that memory. */
move_ptr
(
container_root_gid
);
/* idmap will now keep track of that memory. */
move_ptr
(
host_gid_map
);
TRACE
(
"Allocated minimal idmapping for ns uid %d and ns gid %d"
,
nsuid
,
nsgid
);
TRACE
(
"Allocated minimal idmapping for ns uid %d and ns gid %d"
,
nsuid
,
nsgid
);
...
...
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