commit d4ed763aa5cf8dc8b02914bae4833782bf78e37e Author: Huzaifa Sidhpurwala Date: Thu Jan 15 13:43:53 2015 +0530 Fix a memory leak in s_server.c SSL structure is allocated memory and kssl_ctx (which is a sub-stucture) is allocated memory as well. Later in sv_body(), kctx (instance of kssl_ctx) is allocated memory, this causes the previous memory block to be lost. On my x86_64 machine, this causes 56-bytes of memory leak per connection. Initial Discovery by: hubert Kario Patch by: Huzaifa Sidhpurwala diff --git a/apps/s_server.c b/apps/s_server.c index 412091d..d00bea1 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2249,7 +2249,7 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) } #endif #ifndef OPENSSL_NO_KRB5 - if ((kctx = kssl_ctx_new()) != NULL) + if (kctx != NULL) { SSL_set0_kssl_ctx(con, kctx); kssl_ctx_setstring(kctx, KSSL_SERVICE, KRB5SVC);