mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-02-22 15:20:46 +03:00
fix: close when throw exception (#6019)
This commit is contained in:
parent
dbe45a477b
commit
d2106f278e
|
|
@ -1993,11 +1993,16 @@ def getLocalIP():
|
|||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((conf.hostname, conf.port))
|
||||
retVal, _ = s.getsockname()
|
||||
s.close()
|
||||
except:
|
||||
debugMsg = "there was an error in opening socket "
|
||||
debugMsg += "connection toward '%s'" % conf.hostname
|
||||
logger.debug(debugMsg)
|
||||
finally:
|
||||
if s:
|
||||
try:
|
||||
s.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
return retVal
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user