diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2017-01-24 15:04:13 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2017-01-24 15:04:13 +0000 |
commit | e4193a7dd3b3ebc0dd035764d48bd00a0493f4da (patch) | |
tree | 298db1c9684659cea94325ecd2d4904da967152d | |
parent | 2f9624bd23f8121ff97310d81d6bd551fc7ad8cc (diff) |
sk_free() checks for NULL so do not bother doing it from the callers.
-rw-r--r-- | lib/libssl/d1_srtp.c | 5 | ||||
-rw-r--r-- | lib/libssl/s3_clnt.c | 3 | ||||
-rw-r--r-- | lib/libssl/ssl_cert.c | 6 | ||||
-rw-r--r-- | lib/libssl/ssl_lib.c | 5 |
4 files changed, 9 insertions, 10 deletions
diff --git a/lib/libssl/d1_srtp.c b/lib/libssl/d1_srtp.c index 98bb24b4fef..a9f45a2d9a0 100644 --- a/lib/libssl/d1_srtp.c +++ b/lib/libssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.17 2017/01/23 06:45:30 beck Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.18 2017/01/24 15:04:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -371,8 +371,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, const unsigned char *d, int len, ret = 0; done: - if (clnt) - sk_SRTP_PROTECTION_PROFILE_free(clnt); + sk_SRTP_PROTECTION_PROFILE_free(clnt); return ret; } diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c index e44a025e571..ecd0f9e8865 100644 --- a/lib/libssl/s3_clnt.c +++ b/lib/libssl/s3_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_clnt.c,v 1.172 2017/01/24 14:57:31 jsing Exp $ */ +/* $OpenBSD: s3_clnt.c,v 1.173 2017/01/24 15:04:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1099,6 +1099,7 @@ err: EVP_PKEY_free(pkey); X509_free(x); sk_X509_pop_free(sk, X509_free); + return (ret); } diff --git a/lib/libssl/ssl_cert.c b/lib/libssl/ssl_cert.c index 9ce8585d46f..218a55c1978 100644 --- a/lib/libssl/ssl_cert.c +++ b/lib/libssl/ssl_cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_cert.c,v 1.59 2017/01/24 14:57:31 jsing Exp $ */ +/* $OpenBSD: ssl_cert.c,v 1.60 2017/01/24 15:04:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -610,12 +610,12 @@ err: sk_X509_NAME_pop_free(ret, X509_NAME_free); ret = NULL; } - if (sk != NULL) - sk_X509_NAME_free(sk); + sk_X509_NAME_free(sk); BIO_free(in); X509_free(x); if (ret != NULL) ERR_clear_error(); + return (ret); } diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index bdf6bc6ee38..3c69e66ee11 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.147 2017/01/24 14:57:31 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.148 2017/01/24 15:04:12 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -581,8 +581,7 @@ SSL_free(SSL *s) free(s->internal->alpn_client_proto_list); #ifndef OPENSSL_NO_SRTP - if (s->internal->srtp_profiles) - sk_SRTP_PROTECTION_PROFILE_free(s->internal->srtp_profiles); + sk_SRTP_PROTECTION_PROFILE_free(s->internal->srtp_profiles); #endif free(s->internal); |