mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #7805 from julek-wolfssl/wolfSSL_X509_REQ_add1_attr_by_NID-push-cleanup
wolfSSL_X509_REQ_add1_attr_by_NID: clean up push call for analyzerspull/7823/head
commit
54997837f4
|
@ -14510,11 +14510,12 @@ int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
|
|||
req->reqAttributes->type = STACK_TYPE_X509_REQ_ATTR;
|
||||
}
|
||||
}
|
||||
ret = wolfSSL_sk_push(req->reqAttributes, attr);
|
||||
if ((ret != WOLFSSL_SUCCESS) || (req->reqAttributes->type == STACK_TYPE_CIPHER)) {
|
||||
/* CIPHER type makes a copy */
|
||||
if (req->reqAttributes->type == STACK_TYPE_X509_REQ_ATTR)
|
||||
ret = wolfSSL_sk_push(req->reqAttributes, attr);
|
||||
else
|
||||
ret = WOLFSSL_FAILURE;
|
||||
if (ret != WOLFSSL_SUCCESS)
|
||||
wolfSSL_X509_ATTRIBUTE_free(attr);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue