summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/asn1/x_name.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/libcrypto/asn1/x_name.c b/src/lib/libcrypto/asn1/x_name.c
index 4bf184252f..0961ee33eb 100644
--- a/src/lib/libcrypto/asn1/x_name.c
+++ b/src/lib/libcrypto/asn1/x_name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_name.c,v 1.34 2018/02/20 17:09:20 jsing Exp $ */ 1/* $OpenBSD: x_name.c,v 1.35 2021/07/04 11:38:37 schwarze Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -626,19 +626,13 @@ i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) *_intname, unsigned char **in)
626int 626int
627X509_NAME_set(X509_NAME **xn, X509_NAME *name) 627X509_NAME_set(X509_NAME **xn, X509_NAME *name)
628{ 628{
629 X509_NAME *in; 629 if (*xn == name)
630 630 return *xn != NULL;
631 if (!xn || !name) 631 if ((name = X509_NAME_dup(name)) == NULL)
632 return (0); 632 return 0;
633 633 X509_NAME_free(*xn);
634 if (*xn != name) { 634 *xn = name;
635 in = X509_NAME_dup(name); 635 return 1;
636 if (in != NULL) {
637 X509_NAME_free(*xn);
638 *xn = in;
639 }
640 }
641 return (*xn != NULL);
642} 636}
643 637
644int 638int