From 8bca8af23ec54771fc2d836f78d555c8a965934c Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 23 Aug 2018 02:58:39 +0000 Subject: [PATCH] Close socket when connect fails. Possibly related to #1245 --- nselib/comm.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nselib/comm.lua b/nselib/comm.lua index 426862fb8..4115f0df7 100644 --- a/nselib/comm.lua +++ b/nselib/comm.lua @@ -75,6 +75,7 @@ local setup_connect = function(host, port, opts) local status, err = sock:connect(host, port, opts.proto) if not status then + sock:close() return status, err end