Skip to content

Commit

Permalink
Merge pull request wolfSSL#7805 from julek-wolfssl/wolfSSL_X509_REQ_a…
Browse files Browse the repository at this point in the history
…dd1_attr_by_NID-push-cleanup

wolfSSL_X509_REQ_add1_attr_by_NID: clean up push call for analyzers
  • Loading branch information
dgarske authored Jul 31, 2024
2 parents 1ade735 + 2d5462d commit 5499783
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5499783

Please sign in to comment.