diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2016-09-05 01:59:35 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2016-09-05 01:59:35 +0000 |
commit | 4b93349e9dcf5eba94944650d5a78370fd5c2f9b (patch) | |
tree | 06130894fdb1a2c1c4dff522a354b39bbed2589c /src/namestore | |
parent | c63e2efc25dbd43cb6302891417c7b6145f700a9 (diff) | |
download | gnunet-4b93349e9dcf5eba94944650d5a78370fd5c2f9b.tar.gz gnunet-4b93349e9dcf5eba94944650d5a78370fd5c2f9b.zip |
Fix UAF detected by asan
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 05bcd94ce..effb33e51 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -340,13 +340,6 @@ client_disconnect_notification (void *cls, | |||
340 | client); | 340 | client); |
341 | if (NULL == (nc = GNUNET_SERVER_client_get_user_context (client, struct NamestoreClient))) | 341 | if (NULL == (nc = GNUNET_SERVER_client_get_user_context (client, struct NamestoreClient))) |
342 | return; | 342 | return; |
343 | while (NULL != (no = nc->op_head)) | ||
344 | { | ||
345 | GNUNET_CONTAINER_DLL_remove (nc->op_head, nc->op_tail, no); | ||
346 | GNUNET_free (no); | ||
347 | } | ||
348 | GNUNET_CONTAINER_DLL_remove (client_head, client_tail, nc); | ||
349 | GNUNET_free (nc); | ||
350 | for (zm = monitor_head; NULL != zm; zm = zm->next) | 343 | for (zm = monitor_head; NULL != zm; zm = zm->next) |
351 | { | 344 | { |
352 | if (client == zm->nc->client) | 345 | if (client == zm->nc->client) |
@@ -363,6 +356,13 @@ client_disconnect_notification (void *cls, | |||
363 | break; | 356 | break; |
364 | } | 357 | } |
365 | } | 358 | } |
359 | while (NULL != (no = nc->op_head)) | ||
360 | { | ||
361 | GNUNET_CONTAINER_DLL_remove (nc->op_head, nc->op_tail, no); | ||
362 | GNUNET_free (no); | ||
363 | } | ||
364 | GNUNET_CONTAINER_DLL_remove (client_head, client_tail, nc); | ||
365 | GNUNET_free (nc); | ||
366 | for (cop = cop_head; NULL != cop; cop = cop->next) | 366 | for (cop = cop_head; NULL != cop; cop = cop->next) |
367 | if (client == cop->client) | 367 | if (client == cop->client) |
368 | cop->client = NULL; | 368 | cop->client = NULL; |