Avoid warnings.
[openssl.git] / ssl / ssl_lib.c
index 68c7ae7b6e7a0cae75553409bac3e8c7c72f9ee6..b7b2e4086a250fc65da73476600035d14c92e6a0 100644 (file)
 #include <openssl/objects.h>
 #include <openssl/lhash.h>
 #include <openssl/x509v3.h>
-#include "cryptlib.h"
 
 const char *SSL_version_str=OPENSSL_VERSION_TEXT;
 
@@ -477,6 +476,11 @@ void SSL_free(SSL *s)
 
        if (s->method != NULL) s->method->ssl_free(s);
 
+#ifndef        OPENSSL_NO_KRB5
+       if (s->kssl_ctx != NULL)
+               kssl_ctx_free(s->kssl_ctx);
+#endif /* OPENSSL_NO_KRB5 */
+
        OPENSSL_free(s);
        }
 
@@ -2047,6 +2051,7 @@ SSL *SSL_dup(SSL *s)
                 * they should not both point to the same object,
                 * and thus we can't use SSL_copy_session_id. */
 
+               ret->method->ssl_free(ret);
                ret->method = s->method;
                ret->method->ssl_new(ret);
 
@@ -2201,6 +2206,20 @@ SSL_CIPHER *SSL_get_current_cipher(SSL *s)
        return(NULL);
        }
 
+const COMP_METHOD *SSL_get_current_compression(SSL *s)
+       {
+       if (s->compress != NULL)
+               return(s->compress->meth);
+       return(NULL);
+       }
+
+const COMP_METHOD *SSL_get_current_expansion(SSL *s)
+       {
+       if (s->expand != NULL)
+               return(s->expand->meth);
+       return(NULL);
+       }
+
 int ssl_init_wbio_buffer(SSL *s,int push)
        {
        BIO *bbio;