Free up s->d1->buffered_app_data.q properly.
authorzhu qun-ying <qunying@yahoo.com>
Mon, 2 Jun 2014 13:38:52 +0000 (14:38 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 2 Jun 2014 13:40:18 +0000 (14:40 +0100)
PR#3286
(cherry picked from commit 71e95000afb2227fe5cac1c79ae884338bcd8d0b)

ssl/d1_lib.c

index 106939f24177b7c727c2ddc4a3344df16d19b14f..6bde16fa212c989591a0c46bc484ab864288cf66 100644 (file)
@@ -176,9 +176,12 @@ static void dtls1_clear_queues(SSL *s)
 
        while ( (item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL)
                {
-               frag = (hm_fragment *)item->data;
-               OPENSSL_free(frag->fragment);
-               OPENSSL_free(frag);
+               rdata = (DTLS1_RECORD_DATA *) item->data;
+               if (rdata->rbuf.buf)
+                       {
+                       OPENSSL_free(rdata->rbuf.buf);
+                       }
+               OPENSSL_free(item->data);
                pitem_free(item);
                }
        }