Close the newly-created FD if the pathname is too long.

Coverity:	CID 1007204
Sponsored by:	Netflix, Inc.
This commit is contained in:
Adrian Chadd 2014-01-11 15:01:30 +00:00
parent f1575af8e4
commit 4c766481d0

View File

@ -316,6 +316,7 @@ udom_open(const char *path, int flags)
sou.sun_family = AF_UNIX;
if ((len = strlcpy(sou.sun_path, path,
sizeof(sou.sun_path))) >= sizeof(sou.sun_path)) {
close(fd);
errno = ENAMETOOLONG;
return (-1);
}