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
28027320
Commit
28027320
authored
Apr 14, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix coverity-found resource leaks in config_network_ipv6
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
bb1d2274
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
confile.c
src/lxc/confile.c
+6
-0
No files found.
src/lxc/confile.c
View file @
28027320
...
...
@@ -726,6 +726,7 @@ static int config_network_ipv6(const char *key, const char *value,
list
=
malloc
(
sizeof
(
*
list
));
if
(
!
list
)
{
SYSERROR
(
"failed to allocate memory"
);
free
(
inet6dev
);
return
-
1
;
}
...
...
@@ -735,6 +736,8 @@ static int config_network_ipv6(const char *key, const char *value,
valdup
=
strdup
(
value
);
if
(
!
valdup
)
{
ERROR
(
"no address specified"
);
free
(
list
);
free
(
inet6dev
);
return
-
1
;
}
...
...
@@ -748,6 +751,8 @@ static int config_network_ipv6(const char *key, const char *value,
if
(
!
inet_pton
(
AF_INET6
,
value
,
&
inet6dev
->
addr
))
{
SYSERROR
(
"invalid ipv6 address: %s"
,
value
);
free
(
list
);
free
(
inet6dev
);
free
(
valdup
);
return
-
1
;
}
...
...
@@ -785,6 +790,7 @@ static int config_network_ipv6_gateway(const char *key, const char *value,
}
else
{
if
(
!
inet_pton
(
AF_INET6
,
value
,
gw
))
{
SYSERROR
(
"invalid ipv6 gateway address: %s"
,
value
);
free
(
gw
);
return
-
1
;
}
...
...
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