From 5be7b89ff41f7a676e827e01db93a42afb8679db Mon Sep 17 00:00:00 2001 From: Yuhong Guo Date: Fri, 15 Feb 2019 19:41:38 +0800 Subject: [PATCH] Fix unclosed fd reported by code scan tool --- cpp/src/plasma/io.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc index cc425428ecee5..9ba23e552c230 100644 --- a/cpp/src/plasma/io.cc +++ b/cpp/src/plasma/io.cc @@ -195,6 +195,7 @@ int ConnectIpcSock(const std::string& pathname) { socket_address.sun_family = AF_UNIX; if (pathname.size() + 1 > sizeof(socket_address.sun_path)) { ARROW_LOG(ERROR) << "Socket pathname is too long."; + close(socket_fd); return -1; } strncpy(socket_address.sun_path, pathname.c_str(), pathname.size() + 1);