summaryrefslogtreecommitdiffstats
path: root/lib/libssl/d1_lib.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-05-28 13:03:24 +0000
committerjsing <jsing@openbsd.org>2014-05-28 13:03:24 +0000
commit9d9224c34fa672afefd4702ccd40f7a3f0d33859 (patch)
treeceb592a1008435edad633dfdf1070ac72db0a1ed /lib/libssl/d1_lib.c
parentMore KNF. (diff)
downloadwireguard-openbsd-9d9224c34fa672afefd4702ccd40f7a3f0d33859.tar.xz
wireguard-openbsd-9d9224c34fa672afefd4702ccd40f7a3f0d33859.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 'lib/libssl/d1_lib.c')
-rw-r--r--lib/libssl/d1_lib.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c
index f0b9c1920aa..87bc9b68c6b 100644
--- a/lib/libssl/d1_lib.c
+++ b/lib/libssl/d1_lib.c
@@ -149,18 +149,14 @@ dtls1_clear_queues(SSL *s)
while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *) item->data;
- if (rdata->rbuf.buf) {
- free(rdata->rbuf.buf);
- }
+ free(rdata->rbuf.buf);
free(item->data);
pitem_free(item);
}
while ((item = pqueue_pop(s->d1->processed_rcds.q)) != NULL) {
rdata = (DTLS1_RECORD_DATA *) item->data;
- if (rdata->rbuf.buf) {
- free(rdata->rbuf.buf);
- }
+ free(rdata->rbuf.buf);
free(item->data);
pitem_free(item);
}