zebra: Fix leaked fd.

When we detect an error condition, close down the opened
fd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
This commit is contained in:
Donald Sharp 2018-03-18 21:21:16 -04:00
parent d6716be3d9
commit af734bc7cf

View File

@ -172,6 +172,7 @@ ns_id_t zebra_ns_id_get(const char *netnspath)
if (sock < 0) {
zlog_err("netlink( %u) socket() error: %s", sock,
safe_strerror(errno));
close(fd);
return NS_UNKNOWN;
}
memset(&snl, 0, sizeof(snl));