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
a7307747
Commit
a7307747
authored
May 17, 2015
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: free 'result' in error case.
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
8ec0243d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
conf.c
src/lxc/conf.c
+13
-2
No files found.
src/lxc/conf.c
View file @
a7307747
...
@@ -4564,6 +4564,17 @@ void suggest_default_idmap(void)
...
@@ -4564,6 +4564,17 @@ void suggest_default_idmap(void)
free
(
uname
);
free
(
uname
);
}
}
static
void
free_cgroup_settings
(
struct
lxc_list
*
result
)
{
struct
lxc_list
*
iterator
,
*
next
;
lxc_list_for_each_safe
(
iterator
,
result
,
next
)
{
lxc_list_del
(
iterator
);
free
(
iterator
);
}
free
(
result
);
}
/*
/*
* Return the list of cgroup_settings sorted according to the following rules
* Return the list of cgroup_settings sorted according to the following rules
* 1. Put memory.limit_in_bytes before memory.memsw.limit_in_bytes
* 1. Put memory.limit_in_bytes before memory.memsw.limit_in_bytes
...
@@ -4588,6 +4599,7 @@ struct lxc_list *sort_cgroup_settings(struct lxc_list* cgroup_settings)
...
@@ -4588,6 +4599,7 @@ struct lxc_list *sort_cgroup_settings(struct lxc_list* cgroup_settings)
item
=
malloc
(
sizeof
(
*
item
));
item
=
malloc
(
sizeof
(
*
item
));
if
(
!
item
)
{
if
(
!
item
)
{
ERROR
(
"failed to allocate memory to sort cgroup settings"
);
ERROR
(
"failed to allocate memory to sort cgroup settings"
);
free_cgroup_settings
(
result
);
return
NULL
;
return
NULL
;
}
}
item
->
elem
=
it
->
elem
;
item
->
elem
=
it
->
elem
;
...
@@ -4605,4 +4617,4 @@ struct lxc_list *sort_cgroup_settings(struct lxc_list* cgroup_settings)
...
@@ -4605,4 +4617,4 @@ struct lxc_list *sort_cgroup_settings(struct lxc_list* cgroup_settings)
}
}
return
result
;
return
result
;
}
}
\ No newline at end of file
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