summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_lib.c
diff options
context:
space:
mode:
authorjsing <>2020-09-24 17:59:54 +0000
committerjsing <>2020-09-24 17:59:54 +0000
commite516f9888833076af8ba7f8c411514db2872aa94 (patch)
tree1888b2e1b6ea589c37d114a98388a3b495d52958 /src/lib/libssl/d1_lib.c
parent8fb9c3782c59e736c9e09323162af3af8028e693 (diff)
downloadopenbsd-e516f9888833076af8ba7f8c411514db2872aa94.tar.gz
openbsd-e516f9888833076af8ba7f8c411514db2872aa94.tar.bz2
openbsd-e516f9888833076af8ba7f8c411514db2872aa94.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 'src/lib/libssl/d1_lib.c')
-rw-r--r--src/lib/libssl/d1_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c
index 1f818307d1..758f5195e6 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.46 2020/07/07 19:31:11 jsing Exp $ */ 1/* $OpenBSD: d1_lib.c,v 1.47 2020/09/24 17:59:54 jsing 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.
@@ -132,14 +132,14 @@ dtls1_clear_queues(SSL *s)
132 132
133 while ((item = pqueue_pop(D1I(s)->unprocessed_rcds.q)) != NULL) { 133 while ((item = pqueue_pop(D1I(s)->unprocessed_rcds.q)) != NULL) {
134 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; 134 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data;
135 free(rdata->rbuf.buf); 135 ssl3_release_buffer(&rdata->rbuf);
136 free(item->data); 136 free(item->data);
137 pitem_free(item); 137 pitem_free(item);
138 } 138 }
139 139
140 while ((item = pqueue_pop(D1I(s)->processed_rcds.q)) != NULL) { 140 while ((item = pqueue_pop(D1I(s)->processed_rcds.q)) != NULL) {
141 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; 141 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data;
142 free(rdata->rbuf.buf); 142 ssl3_release_buffer(&rdata->rbuf);
143 free(item->data); 143 free(item->data);
144 pitem_free(item); 144 pitem_free(item);
145 } 145 }
@@ -160,7 +160,7 @@ dtls1_clear_queues(SSL *s)
160 160
161 while ((item = pqueue_pop(D1I(s)->buffered_app_data.q)) != NULL) { 161 while ((item = pqueue_pop(D1I(s)->buffered_app_data.q)) != NULL) {
162 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data; 162 rdata = (DTLS1_RECORD_DATA_INTERNAL *) item->data;
163 free(rdata->rbuf.buf); 163 ssl3_release_buffer(&rdata->rbuf);
164 free(item->data); 164 free(item->data);
165 pitem_free(item); 165 pitem_free(item);
166 } 166 }