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
2446c321
Unverified
Commit
2446c321
authored
Oct 29, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfs: fix invalid free()
And let's be on the safe side by NULLing free()ed variables. Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
ca1faa68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
cgfs.c
src/lxc/cgroups/cgfs.c
+12
-5
No files found.
src/lxc/cgroups/cgfs.c
View file @
2446c321
...
...
@@ -632,10 +632,10 @@ static struct cgroup_meta_data *lxc_cgroup_put_meta(struct cgroup_meta_data *met
if
(
--
meta_data
->
ref
>
0
)
return
meta_data
;
lxc_free_array
((
void
**
)
meta_data
->
mount_points
,
(
lxc_free_fn
)
lxc_cgroup_mount_point_free
);
if
(
meta_data
->
hierarchies
)
{
if
(
meta_data
->
hierarchies
)
for
(
i
=
0
;
i
<=
meta_data
->
maximum_hierarchy
;
i
++
)
lxc_cgroup_hierarchy_free
(
meta_data
->
hierarchies
[
i
]);
}
if
(
meta_data
->
hierarchies
[
i
])
lxc_cgroup_hierarchy_free
(
meta_data
->
hierarchies
[
i
]);
free
(
meta_data
->
hierarchies
);
free
(
meta_data
);
return
NULL
;
...
...
@@ -1798,9 +1798,16 @@ static void lxc_cgroup_hierarchy_free(struct cgroup_hierarchy *h)
{
if
(
!
h
)
return
;
lxc_free_array
((
void
**
)
h
->
subsystems
,
free
);
free
(
h
->
all_mount_points
);
if
(
h
->
subsystems
)
{
lxc_free_array
((
void
**
)
h
->
subsystems
,
free
);
h
->
subsystems
=
NULL
;
}
if
(
h
->
all_mount_points
)
{
free
(
h
->
all_mount_points
);
h
->
all_mount_points
=
NULL
;
}
free
(
h
);
h
=
NULL
;
}
static
bool
is_valid_cgroup
(
const
char
*
name
)
...
...
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