diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/d1_lib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c index d4280a277c..ec68b25140 100644 --- a/src/lib/libssl/d1_lib.c +++ b/src/lib/libssl/d1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_lib.c,v 1.59 2021/08/30 19:12:25 jsing Exp $ */ | 1 | /* $OpenBSD: d1_lib.c,v 1.60 2021/10/21 08:30:14 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -154,6 +154,11 @@ dtls1_free(SSL *s) | |||
154 | 154 | ||
155 | ssl3_free(s); | 155 | ssl3_free(s); |
156 | 156 | ||
157 | if (s->d1 == NULL) | ||
158 | return; | ||
159 | if (D1I(s) == NULL) | ||
160 | goto out; | ||
161 | |||
157 | dtls1_clear_queues(s); | 162 | dtls1_clear_queues(s); |
158 | 163 | ||
159 | pqueue_free(D1I(s)->unprocessed_rcds.q); | 164 | pqueue_free(D1I(s)->unprocessed_rcds.q); |
@@ -161,9 +166,9 @@ dtls1_free(SSL *s) | |||
161 | pqueue_free(s->d1->sent_messages); | 166 | pqueue_free(s->d1->sent_messages); |
162 | pqueue_free(D1I(s)->buffered_app_data.q); | 167 | pqueue_free(D1I(s)->buffered_app_data.q); |
163 | 168 | ||
169 | out: | ||
164 | freezero(s->d1->internal, sizeof(*s->d1->internal)); | 170 | freezero(s->d1->internal, sizeof(*s->d1->internal)); |
165 | freezero(s->d1, sizeof(*s->d1)); | 171 | freezero(s->d1, sizeof(*s->d1)); |
166 | |||
167 | s->d1 = NULL; | 172 | s->d1 = NULL; |
168 | } | 173 | } |
169 | 174 | ||