summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.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_pkt.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_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index c855d0e2a6..db898f507a 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -197,8 +197,7 @@ dtls1_copy_record(SSL *s, pitem *item)
197 197
198 rdata = (DTLS1_RECORD_DATA *)item->data; 198 rdata = (DTLS1_RECORD_DATA *)item->data;
199 199
200 if (s->s3->rbuf.buf != NULL) 200 free(s->s3->rbuf.buf);
201 free(s->s3->rbuf.buf);
202 201
203 s->packet = rdata->packet; 202 s->packet = rdata->packet;
204 s->packet_length = rdata->packet_length; 203 s->packet_length = rdata->packet_length;
@@ -349,8 +348,7 @@ dtls1_get_buffered_record(SSL *s)
349 item = pqueue_pop(s->d1->rcvd_records); 348 item = pqueue_pop(s->d1->rcvd_records);
350 rdata = (DTLS1_RECORD_DATA *)item->data; 349 rdata = (DTLS1_RECORD_DATA *)item->data;
351 350
352 if (s->s3->rbuf.buf != NULL) 351 free(s->s3->rbuf.buf);
353 free(s->s3->rbuf.buf);
354 352
355 s->packet = rdata->packet; 353 s->packet = rdata->packet;
356 s->packet_length = rdata->packet_length; 354 s->packet_length = rdata->packet_length;