Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3498d922
Commit
3498d922
authored
May 10, 2018
by
Jon Siwek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a file descriptor leak in get_mac_addresses()
parent
1d632b76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
libcaf_core/src/get_mac_addresses.cpp
libcaf_core/src/get_mac_addresses.cpp
+3
-0
No files found.
libcaf_core/src/get_mac_addresses.cpp
View file @
3498d922
...
...
@@ -110,6 +110,7 @@ std::vector<iface_info> get_mac_addresses() {
ifc
.
ifc_buf
=
buf
;
if
(
ioctl
(
sck
,
SIOCGIFCONF
,
&
ifc
)
<
0
)
{
perror
(
"ioctl(SIOCGIFCONF)"
);
close
(
sck
);
return
{};
}
std
::
vector
<
iface_info
>
result
;
...
...
@@ -124,6 +125,7 @@ std::vector<iface_info> get_mac_addresses() {
// get mac address
if
(
ioctl
(
sck
,
SIOCGIFHWADDR
,
item
)
<
0
)
{
perror
(
"ioctl(SIOCGIFHWADDR)"
);
close
(
sck
);
return
{};
}
std
::
ostringstream
oss
;
...
...
@@ -140,6 +142,7 @@ std::vector<iface_info> get_mac_addresses() {
result
.
push_back
({
item
->
ifr_name
,
std
::
move
(
addr
)});
}
}
close
(
sck
);
return
result
;
}
...
...
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