server: fix leak of SSL context on free
This could fix issue 434, but only when the config changes all the time
(server_new calls), which is not likely, so there's probably more
getting lost.
Issue: 434
/*
- * Copyright 2013-2019 Fabian Groffen
+ * Copyright 2013-2021 Fabian Groffen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1429,6 +1429,10 @@ server_free(server *s) {
}
queue_destroy(s->queue);
+#ifdef HAVE_SSL
+ if ((s->transport & ~0xFFFF) == W_SSL)
+ SSL_CTX_free(s->strm->ctx);
+#endif
free(s->batch);
if (s->instance)
free(s->instance);
