mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:28:27 +00:00
network: fix socket handle leak
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
This commit is contained in:
parent
f1a571d669
commit
87c6e5db2a
4
src/lxc/network.c
Normal file → Executable file
4
src/lxc/network.c
Normal file → Executable file
@ -2027,8 +2027,10 @@ int setup_private_host_hw_addr(char *veth1)
|
|||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
err = snprintf((char *)ifr.ifr_name, IFNAMSIZ, "%s", veth1);
|
err = snprintf((char *)ifr.ifr_name, IFNAMSIZ, "%s", veth1);
|
||||||
if (err < 0 || (size_t)err >= IFNAMSIZ)
|
if (err < 0 || (size_t)err >= IFNAMSIZ) {
|
||||||
|
close(sockfd);
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
|
}
|
||||||
|
|
||||||
err = ioctl(sockfd, SIOCGIFHWADDR, &ifr);
|
err = ioctl(sockfd, SIOCGIFHWADDR, &ifr);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user