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