Fix some more memory leaks with TXT_DB_insert.
[oweals/openssl.git] / ssl / d1_meth.c
index 734077493f843b96be9316f7f40fcee674f5e883..899010e9851ce356efe3c7ca7163b1517a8066eb 100644 (file)
 static const SSL_METHOD *dtls1_get_method(int ver);
 static const SSL_METHOD *dtls1_get_method(int ver)
 {
-    if (ver == DTLS1_VERSION)
-        return (DTLSv1_method());
+    if (ver == DTLS_ANY_VERSION)
+        return DTLS_method();
+    else if (ver == DTLS1_VERSION)
+        return DTLSv1_method();
     else if (ver == DTLS1_2_VERSION)
-        return (DTLSv1_2_method());
+        return DTLSv1_2_method();
     else
-        return (NULL);
+        return NULL;
 }
 
 IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -77,12 +79,12 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
                           dtls1_accept,
                           dtls1_connect, dtls1_get_method, DTLSv1_enc_data)
 
-    IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
                           DTLSv1_2_method,
                           dtls1_accept,
                           dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data)
 
-    IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
                           DTLS_method,
                           dtls1_accept,
                           dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data)