diff options
author | jsing <> | 2015-03-27 12:26:41 +0000 |
---|---|---|
committer | jsing <> | 2015-03-27 12:26:41 +0000 |
commit | ed007e156e0546eb8a587a5b57c7e0509ea52a2c (patch) | |
tree | ddd7224f5791e70017026b6199caf5a437b5c7d6 | |
parent | 651e65376c2f031d57f2fad3d9773b51f5916111 (diff) | |
download | openbsd-ed007e156e0546eb8a587a5b57c7e0509ea52a2c.tar.gz openbsd-ed007e156e0546eb8a587a5b57c7e0509ea52a2c.tar.bz2 openbsd-ed007e156e0546eb8a587a5b57c7e0509ea52a2c.zip |
BUF_MEM_free() has its own explicit NULL check.
-rw-r--r-- | src/lib/libssl/src/ssl/ssl_lib.c | 15 | ||||
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 15 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/lib/libssl/src/ssl/ssl_lib.c b/src/lib/libssl/src/ssl/ssl_lib.c index d7b5283501..79ce81e70e 100644 --- a/src/lib/libssl/src/ssl/ssl_lib.c +++ b/src/lib/libssl/src/ssl/ssl_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_lib.c,v 1.101 2015/02/22 15:54:27 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.102 2015/03/27 12:26:41 jsing 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 | * |
@@ -188,8 +188,7 @@ int | |||
188 | SSL_clear(SSL *s) | 188 | SSL_clear(SSL *s) |
189 | { | 189 | { |
190 | if (s->method == NULL) { | 190 | if (s->method == NULL) { |
191 | SSLerr(SSL_F_SSL_CLEAR, | 191 | SSLerr(SSL_F_SSL_CLEAR, SSL_R_NO_METHOD_SPECIFIED); |
192 | SSL_R_NO_METHOD_SPECIFIED); | ||
193 | return (0); | 192 | return (0); |
194 | } | 193 | } |
195 | 194 | ||
@@ -203,8 +202,7 @@ SSL_clear(SSL *s) | |||
203 | s->shutdown = 0; | 202 | s->shutdown = 0; |
204 | 203 | ||
205 | if (s->renegotiate) { | 204 | if (s->renegotiate) { |
206 | SSLerr(SSL_F_SSL_CLEAR, | 205 | SSLerr(SSL_F_SSL_CLEAR, ERR_R_INTERNAL_ERROR); |
207 | ERR_R_INTERNAL_ERROR); | ||
208 | return (0); | 206 | return (0); |
209 | } | 207 | } |
210 | 208 | ||
@@ -217,10 +215,8 @@ SSL_clear(SSL *s) | |||
217 | s->rwstate = SSL_NOTHING; | 215 | s->rwstate = SSL_NOTHING; |
218 | s->rstate = SSL_ST_READ_HEADER; | 216 | s->rstate = SSL_ST_READ_HEADER; |
219 | 217 | ||
220 | if (s->init_buf != NULL) { | 218 | BUF_MEM_free(s->init_buf); |
221 | BUF_MEM_free(s->init_buf); | 219 | s->init_buf = NULL; |
222 | s->init_buf = NULL; | ||
223 | } | ||
224 | 220 | ||
225 | ssl_clear_cipher_ctx(s); | 221 | ssl_clear_cipher_ctx(s); |
226 | ssl_clear_hash_ctx(&s->read_hash); | 222 | ssl_clear_hash_ctx(&s->read_hash); |
@@ -240,6 +236,7 @@ SSL_clear(SSL *s) | |||
240 | return (0); | 236 | return (0); |
241 | } else | 237 | } else |
242 | s->method->ssl_clear(s); | 238 | s->method->ssl_clear(s); |
239 | |||
243 | return (1); | 240 | return (1); |
244 | } | 241 | } |
245 | 242 | ||
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index d7b5283501..79ce81e70e 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_lib.c,v 1.101 2015/02/22 15:54:27 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.102 2015/03/27 12:26:41 jsing 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 | * |
@@ -188,8 +188,7 @@ int | |||
188 | SSL_clear(SSL *s) | 188 | SSL_clear(SSL *s) |
189 | { | 189 | { |
190 | if (s->method == NULL) { | 190 | if (s->method == NULL) { |
191 | SSLerr(SSL_F_SSL_CLEAR, | 191 | SSLerr(SSL_F_SSL_CLEAR, SSL_R_NO_METHOD_SPECIFIED); |
192 | SSL_R_NO_METHOD_SPECIFIED); | ||
193 | return (0); | 192 | return (0); |
194 | } | 193 | } |
195 | 194 | ||
@@ -203,8 +202,7 @@ SSL_clear(SSL *s) | |||
203 | s->shutdown = 0; | 202 | s->shutdown = 0; |
204 | 203 | ||
205 | if (s->renegotiate) { | 204 | if (s->renegotiate) { |
206 | SSLerr(SSL_F_SSL_CLEAR, | 205 | SSLerr(SSL_F_SSL_CLEAR, ERR_R_INTERNAL_ERROR); |
207 | ERR_R_INTERNAL_ERROR); | ||
208 | return (0); | 206 | return (0); |
209 | } | 207 | } |
210 | 208 | ||
@@ -217,10 +215,8 @@ SSL_clear(SSL *s) | |||
217 | s->rwstate = SSL_NOTHING; | 215 | s->rwstate = SSL_NOTHING; |
218 | s->rstate = SSL_ST_READ_HEADER; | 216 | s->rstate = SSL_ST_READ_HEADER; |
219 | 217 | ||
220 | if (s->init_buf != NULL) { | 218 | BUF_MEM_free(s->init_buf); |
221 | BUF_MEM_free(s->init_buf); | 219 | s->init_buf = NULL; |
222 | s->init_buf = NULL; | ||
223 | } | ||
224 | 220 | ||
225 | ssl_clear_cipher_ctx(s); | 221 | ssl_clear_cipher_ctx(s); |
226 | ssl_clear_hash_ctx(&s->read_hash); | 222 | ssl_clear_hash_ctx(&s->read_hash); |
@@ -240,6 +236,7 @@ SSL_clear(SSL *s) | |||
240 | return (0); | 236 | return (0); |
241 | } else | 237 | } else |
242 | s->method->ssl_clear(s); | 238 | s->method->ssl_clear(s); |
239 | |||
243 | return (1); | 240 | return (1); |
244 | } | 241 | } |
245 | 242 | ||