Fixed memory leak due to incorrect freeing of DTLS reassembly bit mask

PR#3608

(Imported from upstream's 8a35dbb6d89a16d792b79b157b3e89443639ec94.)

Change-Id: Iab9d91f9b96793f2275a23770f1275ff4edf0386
Reviewed-on: https://boringssl-review.googlesource.com/2476
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2014-12-04 16:23:32 -05:00 committed by Adam Langley
parent e518f65d2c
commit 83abdd6e58
3 changed files with 4 additions and 6 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -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 */