Fix segfault
OpenSSLs close
must not be called more than once. That causes double
frees, access to invalid memory or other nastiness.
Handles are potentially closed multiple times: explicitly when it can't be
reused, and then implicitly via DESTROY
. The second call (via DESTROY
)
either directly segfaults or writes over / frees someone elses memory
causing a segfault a bit later in some random other place.