src/crypto.c: possible fix for memory leak related
authorArt Cancro <ajc@citadel.org>
Tue, 2 May 2006 02:58:22 +0000 (02:58 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 2 May 2006 02:58:22 +0000 (02:58 +0000)
to OpenSSL.  See http://bugs.php.net/bug.php?id=36480 for more info.

webcit/src/crypto.c

index 86d5c7847ce842a58a503cf3aeb113daf8d2118a..77ba8947c210847b98fe290cfa51835a99cfb323 100644 (file)
@@ -378,10 +378,16 @@ int starttls(int sock) {
  */
 void endtls(void)
 {
+       SSL_CTX *ctx = NULL;
+
        if (THREADSSL == NULL) return;
 
        lprintf(5, "Ending SSL/TLS\n");
        SSL_shutdown(THREADSSL);
+       ctx = SSL_get_SSL_CTX(THREADSSL);
+       if (ctx != NULL) {
+               SSL_CTX_free(ctx);
+       }
        SSL_free(THREADSSL);
        pthread_setspecific(ThreadSSL, NULL);
 }