diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 327a1acbf..c75bad870 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -214,8 +214,7 @@ dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) 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 d3d585fdf..c05cdb0f0 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -192,16 +192,14 @@ static void dtls1_clear_queues(SSL *s) 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 4adc2c89c..e8fbf19c8 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -929,6 +929,7 @@ void dtls1_stop_timer(SSL *s); int dtls1_is_timer_expired(SSL *s); void dtls1_double_timeout(SSL *s); unsigned int dtls1_min_mtu(void); +void dtls1_hm_fragment_free(hm_fragment *frag); /* some client-only functions */