summaryrefslogtreecommitdiff
path: root/lib/libssl/ssl_asn1.c
diff options
context:
space:
mode:
authorMichael McConville <mmcc@cvs.openbsd.org>2016-03-11 07:08:46 +0000
committerMichael McConville <mmcc@cvs.openbsd.org>2016-03-11 07:08:46 +0000
commit5314cf13de90502f145d0d5e6b46fea077878daa (patch)
treedcd6e6e59de3993754a35be28e4f982721dfa11a /lib/libssl/ssl_asn1.c
parentd5e0e34531ac0a82cebe041321ea2feba77c572e (diff)
X509_free(3) is NULL-safe, so remove NULL checks before its calls.
ok doug@
Diffstat (limited to 'lib/libssl/ssl_asn1.c')
-rw-r--r--lib/libssl/ssl_asn1.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c
index b60b3ea3f81..ee00cb286d2 100644
--- a/lib/libssl/ssl_asn1.c
+++ b/lib/libssl/ssl_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_asn1.c,v 1.40 2014/12/14 15:30:50 jsing Exp $ */
+/* $OpenBSD: ssl_asn1.c,v 1.41 2016/03/11 07:08:45 mmcc Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -449,10 +449,9 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length)
ret->timeout = 3;
/* 3 - Peer (X509). */
- if (ret->peer != NULL) {
- X509_free(ret->peer);
- ret->peer = NULL;
- }
+ X509_free(ret->peer);
+ ret->peer = NULL;
+
if (c.slen != 0L &&
*c.p == (V_ASN1_CONSTRUCTED | V_ASN1_CONTEXT_SPECIFIC | 3)) {
c.q = c.p;