Oops use up to date patch for PR#2506
authorDr. Stephen Henson <steve@openssl.org>
Wed, 25 May 2011 14:30:20 +0000 (14:30 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 25 May 2011 14:30:20 +0000 (14:30 +0000)
ssl/d1_lib.c
ssl/d1_srvr.c

index fafc5c0..9fe6b2b 100644 (file)
@@ -133,15 +133,26 @@ static void dtls1_clear_queues(SSL *s)
        {
     pitem *item = NULL;
     hm_fragment *frag = NULL;
        {
     pitem *item = NULL;
     hm_fragment *frag = NULL;
-       
+       DTLS1_RECORD_DATA *rdata;
+
     while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
         {
     while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
         {
+               rdata = (DTLS1_RECORD_DATA *) item->data;
+               if (rdata->rbuf.buf)
+                       {
+                       OPENSSL_free(rdata->rbuf.buf);
+                       }
         OPENSSL_free(item->data);
         pitem_free(item);
         }
 
     while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
         {
         OPENSSL_free(item->data);
         pitem_free(item);
         }
 
     while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
         {
+               rdata = (DTLS1_RECORD_DATA *) item->data;
+               if (rdata->rbuf.buf)
+                       {
+                       OPENSSL_free(rdata->rbuf.buf);
+                       }
         OPENSSL_free(item->data);
         pitem_free(item);
         }
         OPENSSL_free(item->data);
         pitem_free(item);
         }
index 2d63199..3a0b4d2 100644 (file)
@@ -150,6 +150,7 @@ int dtls1_accept(SSL *s)
        unsigned long alg_k;
        int ret= -1;
        int new_state,state,skip=0;
        unsigned long alg_k;
        int ret= -1;
        int new_state,state,skip=0;
+       int listen;
 
        RAND_add(&Time,sizeof(Time),0);
        ERR_clear_error();
 
        RAND_add(&Time,sizeof(Time),0);
        ERR_clear_error();
@@ -159,6 +160,8 @@ int dtls1_accept(SSL *s)
                cb=s->info_callback;
        else if (s->ctx->info_callback != NULL)
                cb=s->ctx->info_callback;
                cb=s->info_callback;
        else if (s->ctx->info_callback != NULL)
                cb=s->ctx->info_callback;
+       
+       listen = s->d1->listen;
 
        /* init things to blank */
        s->in_handshake++;
 
        /* init things to blank */
        s->in_handshake++;
@@ -274,7 +277,7 @@ int dtls1_accept(SSL *s)
                        s->init_num=0;
 
                        /* If we're just listening, stop here */
                        s->init_num=0;
 
                        /* If we're just listening, stop here */
-                       if (s->d1->listen && s->state == SSL3_ST_SW_SRVR_HELLO_A)
+                       if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A)
                                {
                                ret = 2;
                                s->d1->listen = 0;
                                {
                                ret = 2;
                                s->d1->listen = 0;