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
54a3b3df
Unverified
Commit
54a3b3df
authored
Aug 06, 2018
by
2xsec
Committed by
Christian Brauner
Aug 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1438229
Resource leak Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
a0a2c1a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
pam_cgfs.c
src/lxc/pam/pam_cgfs.c
+11
-0
No files found.
src/lxc/pam/pam_cgfs.c
View file @
54a3b3df
...
...
@@ -1772,8 +1772,10 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
pam_cgfs_debug
(
"Invalid path: %s.
\n
"
,
path
);
return
bret
;
}
oldv
=
*
lastslash
;
*
lastslash
=
'\0'
;
fpath
=
must_make_path
(
path
,
"cpuset.cpus"
,
NULL
);
posscpus
=
read_file
(
fpath
);
if
(
!
posscpus
)
{
...
...
@@ -1790,6 +1792,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
/* This system doesn't expose isolated cpus. */
pam_cgfs_debug
(
"%s"
,
"Path: "
__ISOL_CPUS
" to read isolated cpus from does not exist.
\n
"
);
cpulist
=
posscpus
;
/* No isolated cpus but we weren't already initialized by
* someone. We should simply copy the parents cpuset.cpus
* values.
...
...
@@ -1798,6 +1801,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
pam_cgfs_debug
(
"%s"
,
"Copying cpuset of parent cgroup.
\n
"
);
goto
copy_parent
;
}
/* No isolated cpus but we were already initialized by someone.
* Nothing more to do for us.
*/
...
...
@@ -1809,9 +1813,11 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
pam_cgfs_debug
(
"%s"
,
"Could not read file "
__ISOL_CPUS
"
\n
"
);
goto
on_error
;
}
if
(
!
isdigit
(
isolcpus
[
0
]))
{
pam_cgfs_debug
(
"%s"
,
"No isolated cpus detected.
\n
"
);
cpulist
=
posscpus
;
/* No isolated cpus but we weren't already initialized by
* someone. We should simply copy the parents cpuset.cpus
* values.
...
...
@@ -1820,6 +1826,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
pam_cgfs_debug
(
"%s"
,
"Copying cpuset of parent cgroup.
\n
"
);
goto
copy_parent
;
}
/* No isolated cpus but we were already initialized by someone.
* Nothing more to do for us.
*/
...
...
@@ -1868,6 +1875,10 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
copy_parent:
*
lastslash
=
oldv
;
if
(
fpath
)
free
(
fpath
);
fpath
=
must_make_path
(
path
,
"cpuset.cpus"
,
NULL
);
ret
=
write_to_file
(
fpath
,
cpulist
,
strlen
(
cpulist
),
false
);
if
(
ret
<
0
)
{
...
...
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