diff options
Diffstat (limited to 'src/lib/libssl/ssl_rsa.c')
-rw-r--r-- | src/lib/libssl/ssl_rsa.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c index 039bee7952..7481524942 100644 --- a/src/lib/libssl/ssl_rsa.c +++ b/src/lib/libssl/ssl_rsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_rsa.c,v 1.20 2015/02/06 01:37:11 reyk Exp $ */ | 1 | /* $OpenBSD: ssl_rsa.c,v 1.21 2016/03/11 07:08:45 mmcc Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -122,8 +122,7 @@ SSL_use_certificate_file(SSL *ssl, const char *file, int type) | |||
122 | 122 | ||
123 | ret = SSL_use_certificate(ssl, x); | 123 | ret = SSL_use_certificate(ssl, x); |
124 | end: | 124 | end: |
125 | if (x != NULL) | 125 | X509_free(x); |
126 | X509_free(x); | ||
127 | BIO_free(in); | 126 | BIO_free(in); |
128 | return (ret); | 127 | return (ret); |
129 | } | 128 | } |
@@ -409,8 +408,7 @@ ssl_set_cert(CERT *c, X509 *x) | |||
409 | 408 | ||
410 | EVP_PKEY_free(pkey); | 409 | EVP_PKEY_free(pkey); |
411 | 410 | ||
412 | if (c->pkeys[i].x509 != NULL) | 411 | X509_free(c->pkeys[i].x509); |
413 | X509_free(c->pkeys[i].x509); | ||
414 | CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); | 412 | CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); |
415 | c->pkeys[i].x509 = x; | 413 | c->pkeys[i].x509 = x; |
416 | c->key = &(c->pkeys[i]); | 414 | c->key = &(c->pkeys[i]); |
@@ -456,8 +454,7 @@ SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) | |||
456 | 454 | ||
457 | ret = SSL_CTX_use_certificate(ctx, x); | 455 | ret = SSL_CTX_use_certificate(ctx, x); |
458 | end: | 456 | end: |
459 | if (x != NULL) | 457 | X509_free(x); |
460 | X509_free(x); | ||
461 | BIO_free(in); | 458 | BIO_free(in); |
462 | return (ret); | 459 | return (ret); |
463 | } | 460 | } |
@@ -706,8 +703,7 @@ ssl_ctx_use_certificate_chain_bio(SSL_CTX *ctx, BIO *in) | |||
706 | } | 703 | } |
707 | 704 | ||
708 | end: | 705 | end: |
709 | if (x != NULL) | 706 | X509_free(x); |
710 | X509_free(x); | ||
711 | return (ret); | 707 | return (ret); |
712 | } | 708 | } |
713 | 709 | ||