diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-13 00:11:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-13 00:11:53 +0000 |
commit | 3e693f3ceb1b3425b17900423628aecb609f2433 (patch) | |
tree | 2dd5d5694771de9458eb8c394ce704dea1d0c87e /src/ats/gnunet-service-ats_addresses.c | |
parent | c1fa22fd40d14035c8d323cb4ae8724970850e73 (diff) | |
download | gnunet-3e693f3ceb1b3425b17900423628aecb609f2433.tar.gz gnunet-3e693f3ceb1b3425b17900423628aecb609f2433.zip |
-fixing misc minor bugs and style issues (unchecked return values, memory leaks, dead code
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.c')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index e96197813..28c474e2c 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -58,9 +58,10 @@ update_addresses_stat () | |||
58 | static void | 58 | static void |
59 | free_address (struct ATS_Address *addr) | 59 | free_address (struct ATS_Address *addr) |
60 | { | 60 | { |
61 | GNUNET_CONTAINER_multipeermap_remove (GSA_addresses, | 61 | GNUNET_assert (GNUNET_YES == |
62 | &addr->peer, | 62 | GNUNET_CONTAINER_multipeermap_remove (GSA_addresses, |
63 | addr); | 63 | &addr->peer, |
64 | addr)); | ||
64 | update_addresses_stat (); | 65 | update_addresses_stat (); |
65 | GAS_plugin_delete_address (addr); | 66 | GAS_plugin_delete_address (addr); |
66 | GAS_performance_notify_all_clients (&addr->peer, | 67 | GAS_performance_notify_all_clients (&addr->peer, |
@@ -551,6 +552,7 @@ transmit_req_addr (struct AddressIteration *ai, | |||
551 | char *addrp; | 552 | char *addrp; |
552 | size_t plugin_name_length; | 553 | size_t plugin_name_length; |
553 | size_t msize; | 554 | size_t msize; |
555 | struct GNUNET_SERVER_NotificationContext **uc; | ||
554 | struct GNUNET_SERVER_NotificationContext *nc; | 556 | struct GNUNET_SERVER_NotificationContext *nc; |
555 | 557 | ||
556 | if (NULL != plugin_name) | 558 | if (NULL != plugin_name) |
@@ -587,13 +589,14 @@ transmit_req_addr (struct AddressIteration *ai, | |||
587 | memcpy (addrp, plugin_addr, plugin_addr_len); | 589 | memcpy (addrp, plugin_addr, plugin_addr_len); |
588 | if (NULL != plugin_name) | 590 | if (NULL != plugin_name) |
589 | strcpy (&addrp[plugin_addr_len], plugin_name); | 591 | strcpy (&addrp[plugin_addr_len], plugin_name); |
590 | nc = *GNUNET_SERVER_client_get_user_context (ai->client, | 592 | uc = GNUNET_SERVER_client_get_user_context (ai->client, |
591 | struct GNUNET_SERVER_NotificationContext *); | 593 | struct GNUNET_SERVER_NotificationContext *); |
592 | if (NULL == nc) | 594 | if (NULL == uc) |
593 | { | 595 | { |
594 | GNUNET_break (0); | 596 | GNUNET_break (0); |
595 | return; | 597 | return; |
596 | } | 598 | } |
599 | nc = *uc; | ||
597 | GNUNET_SERVER_notification_context_unicast (nc, | 600 | GNUNET_SERVER_notification_context_unicast (nc, |
598 | ai->client, | 601 | ai->client, |
599 | &msg->header, | 602 | &msg->header, |