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
ca4bad79
Unverified
Commit
ca4bad79
authored
Dec 07, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425888
check return value of getifaddrs() Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
7641e5d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
network.c
src/lxc/network.c
+6
-1
No files found.
src/lxc/network.c
View file @
ca4bad79
...
...
@@ -1915,6 +1915,7 @@ static const char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char
*
lxc_mkifname
(
char
*
template
)
{
int
ret
;
unsigned
int
seed
;
FILE
*
urandom
;
struct
ifaddrs
*
ifa
,
*
ifaddr
;
...
...
@@ -1926,7 +1927,11 @@ char *lxc_mkifname(char *template)
return
NULL
;
/* Get all the network interfaces. */
getifaddrs
(
&
ifaddr
);
ret
=
getifaddrs
(
&
ifaddr
);
if
(
ret
<
0
)
{
ERROR
(
"%s - Failed to get network interfaces"
,
strerror
(
errno
));
return
NULL
;
}
/* Initialize the random number generator. */
urandom
=
fopen
(
"/dev/urandom"
,
"r"
);
...
...
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