diff options
| author | jsing <> | 2015-03-27 12:26:41 +0000 | 
|---|---|---|
| committer | jsing <> | 2015-03-27 12:26:41 +0000 | 
| commit | 3c33e1429e1b0d6e6a121c97b536af97a1fd8e0a (patch) | |
| tree | ddd7224f5791e70017026b6199caf5a437b5c7d6 /src/lib/libssl/ssl_lib.c | |
| parent | 1528a0d1b9587583b1d71e5c756a609e4c5bc233 (diff) | |
| download | openbsd-3c33e1429e1b0d6e6a121c97b536af97a1fd8e0a.tar.gz openbsd-3c33e1429e1b0d6e6a121c97b536af97a1fd8e0a.tar.bz2 openbsd-3c33e1429e1b0d6e6a121c97b536af97a1fd8e0a.zip  | |
BUF_MEM_free() has its own explicit NULL check.
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 15 | 
1 files changed, 6 insertions, 9 deletions
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 | ||
