summaryrefslogtreecommitdiff
path: root/thirdparty/openssl/crypto/asn1/x_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/openssl/crypto/asn1/x_name.c')
-rw-r--r--thirdparty/openssl/crypto/asn1/x_name.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/thirdparty/openssl/crypto/asn1/x_name.c b/thirdparty/openssl/crypto/asn1/x_name.c
index 1fb7ad1cbf..aea0c2763c 100644
--- a/thirdparty/openssl/crypto/asn1/x_name.c
+++ b/thirdparty/openssl/crypto/asn1/x_name.c
@@ -523,19 +523,11 @@ static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname,
int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
{
- X509_NAME *in;
-
- if (!xn || !name)
- return (0);
-
- if (*xn != name) {
- in = X509_NAME_dup(name);
- if (in != NULL) {
- X509_NAME_free(*xn);
- *xn = in;
- }
- }
- return (*xn != NULL);
+ if ((name = X509_NAME_dup(name)) == NULL)
+ return 0;
+ X509_NAME_free(*xn);
+ *xn = name;
+ return 1;
}
IMPLEMENT_STACK_OF(X509_NAME_ENTRY)