Unverified Commit 20b88030 by Donghwa Jeong Committed by Christian Brauner

network: fix socket handle leak

parent 6bbfd894
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment