aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509/v3_lib.c
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2025-07-11 00:18:38 +0000
committerEnji Cooper <ngie@FreeBSD.org>2025-07-11 00:18:38 +0000
commitecf8229ffeb17a05c78fab6b973b0cccb84e25c5 (patch)
treeda8cf5ccc84d9bc3fbadcf674c7d501f9ca7ab5d /crypto/x509/v3_lib.c
parent1c34280346af8284acdc0eae39496811d37df25d (diff)
Diffstat (limited to 'crypto/x509/v3_lib.c')
-rw-r--r--crypto/x509/v3_lib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/x509/v3_lib.c b/crypto/x509/v3_lib.c
index 5ffeb75d9f5b..6d91df99550f 100644
--- a/crypto/x509/v3_lib.c
+++ b/crypto/x509/v3_lib.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
*
* 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
@@ -99,7 +99,11 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from)
*tmpext = *ext;
tmpext->ext_nid = nid_to;
tmpext->ext_flags |= X509V3_EXT_DYNAMIC;
- return X509V3_EXT_add(tmpext);
+ if (!X509V3_EXT_add(tmpext)) {
+ OPENSSL_free(tmpext);
+ return 0;
+ }
+ return 1;
}
void X509V3_EXT_cleanup(void)