just when it sends abnormally. This fixes that huge memory
leak I've been trying to find all this time.
lprintf(5, "Ending SSL/TLS\n");
SSL_shutdown(THREADSSL);
ctx = SSL_get_SSL_CTX(THREADSSL);
- if (ctx != NULL) {
- SSL_CTX_free(ctx);
- }
+
+ /** I don't think this is needed, and it crashes the server anyway
+ *
+ * if (ctx != NULL) {
+ * lprintf(9, "Freeing CTX at %x\n", (int)ctx );
+ * SSL_CTX_free(ctx);
+ * }
+ */
+
SSL_free(THREADSSL);
pthread_setspecific(ThreadSSL, NULL);
}
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
+#include <malloc.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/un.h>
#endif
if (fail_this_transaction == 0) {
+
/** Perform an HTTP transaction... */
context_loop(ssock);
+
+ /** Shut down SSL/TLS if required... */
+ if (is_https) {
+ endtls();
+ }
+
/** ...and close the socket. */
lingering_close(ssock);
}