aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509/x_attrib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/x_attrib.c')
-rw-r--r--crypto/x509/x_attrib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/x509/x_attrib.c b/crypto/x509/x_attrib.c
index 813c5b01c3ae..7342c4f6bcb5 100644
--- a/crypto/x509/x_attrib.c
+++ b/crypto/x509/x_attrib.c
@@ -37,10 +37,13 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value)
{
X509_ATTRIBUTE *ret = NULL;
ASN1_TYPE *val = NULL;
+ ASN1_OBJECT *oid;
+ if ((oid = OBJ_nid2obj(nid)) == NULL)
+ return NULL;
if ((ret = X509_ATTRIBUTE_new()) == NULL)
return NULL;
- ret->object = OBJ_nid2obj(nid);
+ ret->object = oid;
if ((val = ASN1_TYPE_new()) == NULL)
goto err;
if (!sk_ASN1_TYPE_push(ret->set, val))