summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_lib.c
diff options
context:
space:
mode:
authorjsing <>2014-05-28 13:03:25 +0000
committerjsing <>2014-05-28 13:03:25 +0000
commit1904ce01988b6ea0f5775507b4d812459c5b3f50 (patch)
tree60af46eb8cb0fcb0e51840739e416c98c124d73c /src/lib/libssl/d1_lib.c
parent60cd1d60f58b32225afb881559d08dbc68a2eb79 (diff)
downloadopenbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.gz
openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.bz2
openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.zip
There is no point in checking if a pointer is non-NULL before calling free,
since free already does this for us. Also remove some pointless NULL assignments, where the result from malloc(3) is immediately assigned to the same variable. ok miod@
Diffstat (limited to 'src/lib/libssl/d1_lib.c')
-rw-r--r--src/lib/libssl/d1_lib.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c
index f0b9c1920a..87bc9b68c6 100644
--- a/src/lib/libssl/d1_lib.c
+++ b/src/lib/libssl/d1_lib.c
@@ -149,18 +149,14 @@ dtls1_clear_queues(SSL *s)
149 149
150 while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) { 150 while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
151 rdata = (DTLS1_RECORD_DATA *) item->data; 151 rdata = (DTLS1_RECORD_DATA *) item->data;
152 if (rdata->rbuf.buf) { 152 free(rdata->rbuf.buf);
153 free(rdata->rbuf.buf);
154 }
155 free(item->data); 153 free(item->data);
156 pitem_free(item); 154 pitem_free(item);
157 } 155 }
158 156
159 while ((item = pqueue_pop(s->d1->processed_rcds.q)) != NULL) { 157 while ((item = pqueue_pop(s->d1->processed_rcds.q)) != NULL) {
160 rdata = (DTLS1_RECORD_DATA *) item->data; 158 rdata = (DTLS1_RECORD_DATA *) item->data;
161 if (rdata->rbuf.buf) { 159 free(rdata->rbuf.buf);
162 free(rdata->rbuf.buf);
163 }
164 free(item->data); 160 free(item->data);
165 pitem_free(item); 161 pitem_free(item);
166 } 162 }