gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33715 - gnunet/src/scalarproduct


From: gnunet
Subject: [GNUnet-SVN] r33715 - gnunet/src/scalarproduct
Date: Tue, 17 Jun 2014 22:11:21 +0200

Author: grothoff
Date: 2014-06-17 22:11:21 +0200 (Tue, 17 Jun 2014)
New Revision: 33715

Modified:
   gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
Log:
-fix use after free

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2014-06-17 
20:08:32 UTC (rev 33714)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2014-06-17 
20:11:21 UTC (rev 33715)
@@ -594,7 +594,7 @@
     s->client_transmit_handle = NULL;
     free_session_variables (s);
     break;
-    
+
   case GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION:
     s->service_transmit_handle = NULL;
     break;
@@ -1230,7 +1230,7 @@
     //this element has been removed from the set
     se = GNUNET_CONTAINER_multihashmap_get (s->intersected_elements,
                                             element->data);
-    
+
     GNUNET_CONTAINER_multihashmap_remove (s->intersected_elements,
                                           element->data,
                                           se);
@@ -1251,7 +1251,7 @@
       // continue after the loop
       break;
     }
-    
+
     s->sorted_elements = GNUNET_malloc (s->used_element_count * sizeof 
(gcry_mpi_t));
     for (i = 0; NULL != s->a_head; i++)
     {
@@ -1281,14 +1281,14 @@
       GNUNET_SET_listen_cancel (s->intersection_listen);
       s->intersection_listen = NULL;
     }
-    
+
     // the op failed and has already been invalidated by the set service
     break;
   }
 
   s->intersection_op = NULL;
   s->intersection_set = NULL;
-  
+
   //failed if we go here
   GNUNET_break_op (0);
 
@@ -1916,7 +1916,6 @@
     if ((NULL != s->response ) && (GNUNET_NO == s->active) && (GNUNET_YES == 
client_session->active))
       client_session->active = GNUNET_NO;
     free_session_variables (s);
-    GNUNET_free (s);
 
     // the client has to check if it was waiting for a result
     // or if it was a responder, no point in adding more statefulness
@@ -1926,6 +1925,7 @@
               GNUNET_SCHEDULER_add_now (&prepare_client_end_notification,
                                         client_session);
     }
+    GNUNET_free (s);
   }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]