Raise an error on syscall failure in tls_retry_write_records
[openssl.git] / crypto / x509 / x509_meth.c
index 05ed4bf863721968bf9447a02735d77a5f2335a4..305fe4c6d390c9bdb0bb526678e6c898410718b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
@@ -14,8 +14,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
-#include <openssl/ossl_typ.h>
-#include "x509_lcl.h"
+#include <openssl/types.h>
+#include "x509_local.h"
 
 X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name)
 {
@@ -23,10 +23,8 @@ X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name)
 
     if (method != NULL) {
         method->name = OPENSSL_strdup(name);
-        if (method->name == NULL) {
-            X509err(X509_F_X509_LOOKUP_METH_NEW, ERR_R_MALLOC_FAILURE);
+        if (method->name == NULL)
             goto err;
-        }
     }
 
     return method;
@@ -58,9 +56,9 @@ int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
 
 int X509_LOOKUP_meth_set_free(
     X509_LOOKUP_METHOD *method,
-    void (*free) (X509_LOOKUP *ctx))
+    void (*free_fn) (X509_LOOKUP *ctx))
 {
-    method->free = free;
+    method->free = free_fn;
     return 1;
 }