diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 0daac7caec70..f724cb0b8b9a 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -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);
 		}