From 6595577d6e06976343974ba33a2feca1e5cf4c08 Mon Sep 17 00:00:00 2001 From: batrick Date: Wed, 1 Jul 2009 21:43:49 +0000 Subject: [PATCH] Close the socket when finished getting the banner. --- nselib/comm.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nselib/comm.lua b/nselib/comm.lua index 4d04d1ba0..c91889fc1 100644 --- a/nselib/comm.lua +++ b/nselib/comm.lua @@ -96,7 +96,10 @@ get_banner = function(host, port, opts) opts = initopts(opts) opts.recv_before = true local socket, nothing, correct, banner = tryssl(host, port, "", opts) - if socket then return true, banner end + if socket then + socket:close() + return true, banner + end return false, banner end