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
8424b4e1
Unverified
Commit
8424b4e1
authored
Aug 31, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-user-nic: free memory and check for error
- check for error on ifindex retrieval - free allocated memory Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d0b915aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
lxc_user_nic.c
src/lxc/lxc_user_nic.c
+8
-0
No files found.
src/lxc/lxc_user_nic.c
View file @
8424b4e1
...
...
@@ -453,6 +453,8 @@ static int get_mtu(char *name)
int
idx
;
idx
=
if_nametoindex
(
name
);
if
(
idx
<
0
)
return
-
1
;
return
netdev_get_mtu
(
idx
);
}
...
...
@@ -1215,6 +1217,12 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
host_veth_ifidx
=
if_nametoindex
(
nicname
);
if
(
!
host_veth_ifidx
)
{
free
(
newname
);
free
(
nicname
);
usernic_error
(
"Failed to get netdev index: %s
\n
"
,
strerror
(
errno
));
exit
(
EXIT_FAILURE
);
}
/* Write names of veth pairs and their ifindeces to stout:
* (e.g. eth0:731:veth9MT2L4:730)
...
...
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