Python
Correctness
socket-shutdown-close
socket-shutdown-close
Socket is not closed if shutdown fails. When socket.shutdown fails on an OSError, socket.close is not called and the code fails to clean up the socket and allow garbage collection to release the memory used for it. The OSError on shutdown can occur when the remote side of the connection closes the connection first.
suppressed-exception-handling-finally-break
suppressed-exception-handling-finally-break
Having a break
, continue
, or return
in a finally
block will cause strange behaviors, like exceptions not being caught.