Our free functions should be able to deal with the case where the object
being freed is NULL. This turns out to not be quite the case for DTLS
related objects.
Fixes #13649
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13655)
(cherry picked from commit
d0afb30ef3950cacff50ec539e90073b95a276df)
ssl3_free(s);
- dtls1_clear_queues(s);
-
- pqueue_free(s->d1->buffered_messages);
- pqueue_free(s->d1->sent_messages);
+ if (s->d1 != NULL) {
+ dtls1_clear_queues(s);
+ pqueue_free(s->d1->buffered_messages);
+ pqueue_free(s->d1->sent_messages);
+ }
OPENSSL_free(s->d1);
s->d1 = NULL;
void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl)
{
+ if (rl->d == NULL)
+ return;
+
DTLS_RECORD_LAYER_clear(rl);
pqueue_free(rl->d->unprocessed_rcds.q);
pqueue_free(rl->d->processed_rcds.q);