diff options
author | 2020-09-24 17:59:54 +0000 | |
---|---|---|
committer | 2020-09-24 17:59:54 +0000 | |
commit | 435f94b74e31aaa328aa82ba94c8fdad60dbb4d7 (patch) | |
tree | 7386ada5c49e9ffdf8de1e0b91ddd85d53355dd2 /lib/libssl/d1_lib.c | |
parent | mi_ast() needs curcpu()->ci_want_resched rather than ci->ci_want_resched, (diff) | |
download | wireguard-openbsd-435f94b74e31aaa328aa82ba94c8fdad60dbb4d7.tar.xz wireguard-openbsd-435f94b74e31aaa328aa82ba94c8fdad60dbb4d7.zip |
Release read and write buffers using freezero().
Provide a ssl3_release_buffer() function that correctly frees a buffer
and call it from the appropriate locations. While here also change
ssl3_release_{read,write}_buffer() to void since they cannot fail and
no callers check the return value currently.
ok beck@ inoguchi@ tb@
Diffstat (limited to 'lib/libssl/d1_lib.c')
-rw-r--r-- | lib/libssl/d1_lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c index 1f818307d11..758f5195e64 100644 --- a/lib/libssl/d1_lib.c +++ b/lib/libssl/d1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_lib.c,v 1.46 2020/07/07 19:31:11 jsing Exp $ */ +/* $OpenBSD: d1_lib.c,v 1.47 2020/09/24 17:59:54 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -132,14 +132,14 @@ dtls1_clear_queues(SSL *s) while ((item = pqueue_pop(D1I(s)->unprocessed_rcds.q)) != NULL) { rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; - free(rdata->rbuf.buf); + ssl3_release_buffer(&rdata->rbuf); free(item->data); pitem_free(item); } while ((item = pqueue_pop(D1I(s)->processed_rcds.q)) != NULL) { rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; - free(rdata->rbuf.buf); + ssl3_release_buffer(&rdata->rbuf); free(item->data); pitem_free(item); } @@ -160,7 +160,7 @@ dtls1_clear_queues(SSL *s) while ((item = pqueue_pop(D1I(s)->buffered_app_data.q)) != NULL) { rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; - free(rdata->rbuf.buf); + ssl3_release_buffer(&rdata->rbuf); free(item->data); pitem_free(item); } |