Fixed memory leak due to incorrect freeing of DTLS reassembly bit mask
PR#3608
Reviewed-by: Tim Hudson <tjh@openssl.org>
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index f2ff943..2324675 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -211,8 +211,7 @@
return frag;
}
-static void
-dtls1_hm_fragment_free(hm_fragment *frag)
+void dtls1_hm_fragment_free(hm_fragment *frag)
{
if (frag->msg_header.is_ccs)
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 5f7a358..ab8730c 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -187,16 +187,14 @@
while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
- OPENSSL_free(frag->fragment);
- OPENSSL_free(frag);
+ dtls1_hm_fragment_free(frag);
pitem_free(item);
}
while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
- OPENSSL_free(frag->fragment);
- OPENSSL_free(frag);
+ dtls1_hm_fragment_free(frag);
pitem_free(item);
}
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index 0600f37..c5de193 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -1219,6 +1219,7 @@
void dtls1_double_timeout(SSL *s);
int dtls1_send_newsession_ticket(SSL *s);
unsigned int dtls1_min_mtu(void);
+void dtls1_hm_fragment_free(hm_fragment *frag);
/* some client-only functions */
int ssl3_client_hello(SSL *s);