From 90e12ab9258573aa46651640ecdbfaf24812068e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 19 Jul 2006 18:41:36 +0200 Subject: [PATCH] apcups plugin: Close the socket when `connect' failes. Otherwise people will get `Too many open files' faily soon. --- src/apcups.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apcups.c b/src/apcups.c index 9117bdae..f7486f5f 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -208,6 +208,7 @@ static int net_open (char *host, char *service, int port) if (status != 0) /* `connect(2)' failed */ { DBG ("connect failed: %s", strerror (errno)); + close (sd); return (-1); } -- 2.11.0