diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2017-12-08 10:49:41 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-12-08 10:49:41 -0500 |
commit | a0fda2cf2dac8bc0d309261b3aaf4027a188b08c (patch) | |
tree | cdb682c910f5ae4825b1e3686facb1073f35c56d /crypto/asn1 | |
parent | cef115ff0ca4255d3decc1dda87c5418a961fd2c (diff) |
Address some code-analysis issues.
Expression '...' is always true.
The 'b->init' variable is assigned values twice successively
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4753)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/x_algor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c index 72378db922..853d45b8bc 100644 --- a/crypto/asn1/x_algor.c +++ b/crypto/asn1/x_algor.c @@ -28,18 +28,19 @@ IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR) int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) { - if (!alg) + if (alg == NULL) return 0; + if (ptype != V_ASN1_UNDEF) { if (alg->parameter == NULL) alg->parameter = ASN1_TYPE_new(); if (alg->parameter == NULL) return 0; } - if (alg) { - ASN1_OBJECT_free(alg->algorithm); - alg->algorithm = aobj; - } + + ASN1_OBJECT_free(alg->algorithm); + alg->algorithm = aobj; + if (ptype == 0) return 1; if (ptype == V_ASN1_UNDEF) { |