Merge pull request #2355 from 2xsec/master

network: fix socket handle leak
This commit is contained in:
Christian Brauner 2018-05-28 08:27:59 +02:00 committed by GitHub
commit b71841358e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
src/lxc/network.c Normal file → Executable file
View File

@ -2027,8 +2027,10 @@ int setup_private_host_hw_addr(char *veth1)
return -errno;
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;
}
err = ioctl(sockfd, SIOCGIFHWADDR, &ifr);
if (err < 0) {