diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-17 20:11:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-17 20:11:21 +0000 |
commit | be6d8d67500548d86044f072a799e567ae018f62 (patch) | |
tree | 5104648e149fb584ee5217f88dd8dd0e80f989fc /src/scalarproduct | |
parent | 8c1949a798fdef1a809b4aabbca711b977b9263c (diff) | |
download | gnunet-be6d8d67500548d86044f072a799e567ae018f62.tar.gz gnunet-be6d8d67500548d86044f072a799e567ae018f62.zip |
-fix use after free
Diffstat (limited to 'src/scalarproduct')
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct.c b/src/scalarproduct/gnunet-service-scalarproduct.c index fd9980060..99146622e 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct.c +++ b/src/scalarproduct/gnunet-service-scalarproduct.c | |||
@@ -594,7 +594,7 @@ cb_transfer_message (void *cls, | |||
594 | s->client_transmit_handle = NULL; | 594 | s->client_transmit_handle = NULL; |
595 | free_session_variables (s); | 595 | free_session_variables (s); |
596 | break; | 596 | break; |
597 | 597 | ||
598 | case GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION: | 598 | case GNUNET_MESSAGE_TYPE_SCALARPRODUCT_SESSION_INITIALIZATION: |
599 | s->service_transmit_handle = NULL; | 599 | s->service_transmit_handle = NULL; |
600 | break; | 600 | break; |
@@ -1230,7 +1230,7 @@ cb_intersection_element_removed (void *cls, | |||
1230 | //this element has been removed from the set | 1230 | //this element has been removed from the set |
1231 | se = GNUNET_CONTAINER_multihashmap_get (s->intersected_elements, | 1231 | se = GNUNET_CONTAINER_multihashmap_get (s->intersected_elements, |
1232 | element->data); | 1232 | element->data); |
1233 | 1233 | ||
1234 | GNUNET_CONTAINER_multihashmap_remove (s->intersected_elements, | 1234 | GNUNET_CONTAINER_multihashmap_remove (s->intersected_elements, |
1235 | element->data, | 1235 | element->data, |
1236 | se); | 1236 | se); |
@@ -1251,7 +1251,7 @@ cb_intersection_element_removed (void *cls, | |||
1251 | // continue after the loop | 1251 | // continue after the loop |
1252 | break; | 1252 | break; |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | s->sorted_elements = GNUNET_malloc (s->used_element_count * sizeof (gcry_mpi_t)); | 1255 | s->sorted_elements = GNUNET_malloc (s->used_element_count * sizeof (gcry_mpi_t)); |
1256 | for (i = 0; NULL != s->a_head; i++) | 1256 | for (i = 0; NULL != s->a_head; i++) |
1257 | { | 1257 | { |
@@ -1281,14 +1281,14 @@ cb_intersection_element_removed (void *cls, | |||
1281 | GNUNET_SET_listen_cancel (s->intersection_listen); | 1281 | GNUNET_SET_listen_cancel (s->intersection_listen); |
1282 | s->intersection_listen = NULL; | 1282 | s->intersection_listen = NULL; |
1283 | } | 1283 | } |
1284 | 1284 | ||
1285 | // the op failed and has already been invalidated by the set service | 1285 | // the op failed and has already been invalidated by the set service |
1286 | break; | 1286 | break; |
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | s->intersection_op = NULL; | 1289 | s->intersection_op = NULL; |
1290 | s->intersection_set = NULL; | 1290 | s->intersection_set = NULL; |
1291 | 1291 | ||
1292 | //failed if we go here | 1292 | //failed if we go here |
1293 | GNUNET_break_op (0); | 1293 | GNUNET_break_op (0); |
1294 | 1294 | ||
@@ -1916,7 +1916,6 @@ cb_channel_destruction (void *cls, | |||
1916 | if ((NULL != s->response ) && (GNUNET_NO == s->active) && (GNUNET_YES == client_session->active)) | 1916 | if ((NULL != s->response ) && (GNUNET_NO == s->active) && (GNUNET_YES == client_session->active)) |
1917 | client_session->active = GNUNET_NO; | 1917 | client_session->active = GNUNET_NO; |
1918 | free_session_variables (s); | 1918 | free_session_variables (s); |
1919 | GNUNET_free (s); | ||
1920 | 1919 | ||
1921 | // the client has to check if it was waiting for a result | 1920 | // the client has to check if it was waiting for a result |
1922 | // or if it was a responder, no point in adding more statefulness | 1921 | // or if it was a responder, no point in adding more statefulness |
@@ -1926,6 +1925,7 @@ cb_channel_destruction (void *cls, | |||
1926 | GNUNET_SCHEDULER_add_now (&prepare_client_end_notification, | 1925 | GNUNET_SCHEDULER_add_now (&prepare_client_end_notification, |
1927 | client_session); | 1926 | client_session); |
1928 | } | 1927 | } |
1928 | GNUNET_free (s); | ||
1929 | } | 1929 | } |
1930 | } | 1930 | } |
1931 | 1931 | ||