Fix memory leak.
Fail if /dev/urandom doesn't exist or returns zero bytes. This doesn't check
for /dev/urandom returning less than 1024 bytes, since libssl doesn't check for
this either I figured it would be okay.
Instead of converting back and forth between integer and string representation
of a port, let getaddrinfo deal with it. As a bonus now you can specify "https"
as a port.
exit(3) in usage(), I think this was the intent of the author.
usage() is usually printed to stderr.
Plug FD leak.
Set getaddrinfo hints free.
Plug FD leak.
Strings that are dynamically allocated by OpenSSL should be freed by OpenSSL.
Internal OpenSSL strings shouldn't be freed.
After the tmp variable has been freed make it NULL to avoid double frees or
erroneous use.
More cases where OpenSSL should free the dynamically allocated data.
Fix a bunch of memory leaks.
Merge pull request #1 from flupzor/miscfixes

Fixes memory leaks
The non-existence of /dev/urandom is tolerated now
Let getaddrinfo() figure out how the port number should be converted.
Clean ups in the usage() printing and also the usage() is now printed on stderr.
Fixes various file descriptor leakages.
Dynamic allocated strings are free()-ed with OpenSSL's free function.
Various memory leakages.
Hooked the TLS 1.1 and TLS 1.2 support relative to the OpenSSL version
Removed the CUSTOMSSL setting in the Makefile
Adding wildcard matching to the RFC2818 checks.
Adding heartbeat availability test
Make sure the initial fingerprint string is empty, so data can be appended to
it.

While there remove a superfluous NULL check.