diff options
-rw-r--r-- | src/vpn/gnunet-daemon-exit.c | 18 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index e75e1e6cd..da8392ebe 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c | |||
@@ -125,12 +125,26 @@ struct udp_state | |||
125 | static struct GNUNET_CONTAINER_MultiHashMap *udp_services; | 125 | static struct GNUNET_CONTAINER_MultiHashMap *udp_services; |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Function that frees everything from a hashmap | ||
129 | */ | ||
130 | static int | ||
131 | free_iterate(void* cls, const GNUNET_HashCode* hash, void* value) | ||
132 | { | ||
133 | GNUNET_free(value); | ||
134 | return GNUNET_YES; | ||
135 | } | ||
136 | |||
137 | /** | ||
128 | * Function scheduled as very last function, cleans up after us | 138 | * Function scheduled as very last function, cleans up after us |
129 | */ | 139 | */ |
130 | static void | 140 | static void |
131 | cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) { | 141 | cleanup(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tskctx) { |
132 | GNUNET_assert (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)); | 142 | GNUNET_assert (0 != (tskctx->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)); |
133 | 143 | ||
144 | GNUNET_CONTAINER_multihashmap_iterate(udp_connections, | ||
145 | free_iterate, | ||
146 | NULL); | ||
147 | |||
134 | if (mesh_handle != NULL) | 148 | if (mesh_handle != NULL) |
135 | { | 149 | { |
136 | GNUNET_MESH_disconnect(mesh_handle); | 150 | GNUNET_MESH_disconnect(mesh_handle); |
@@ -501,6 +515,8 @@ receive_udp_service (void *cls, | |||
501 | GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "exit", "IPV4MASK", &ipv4mask)); | 515 | GNUNET_assert(GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(cfg, "exit", "IPV4MASK", &ipv4mask)); |
502 | inet_pton(AF_INET, ipv4addr, &tmp); | 516 | inet_pton(AF_INET, ipv4addr, &tmp); |
503 | inet_pton(AF_INET, ipv4mask, &tmp2); | 517 | inet_pton(AF_INET, ipv4mask, &tmp2); |
518 | GNUNET_free(ipv4addr); | ||
519 | GNUNET_free(ipv4mask); | ||
504 | 520 | ||
505 | /* This should be a noop */ | 521 | /* This should be a noop */ |
506 | tmp = tmp & tmp2; | 522 | tmp = tmp & tmp2; |
@@ -586,6 +602,8 @@ receive_udp_service (void *cls, | |||
586 | GNUNET_CONTAINER_multihashmap_contains (udp_connections, &hash)) | 602 | GNUNET_CONTAINER_multihashmap_contains (udp_connections, &hash)) |
587 | GNUNET_CONTAINER_multihashmap_put (udp_connections, &hash, state, | 603 | GNUNET_CONTAINER_multihashmap_put (udp_connections, &hash, state, |
588 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 604 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
605 | else | ||
606 | GNUNET_free(state); | ||
589 | 607 | ||
590 | (void)GNUNET_DISK_file_write(helper_handle->fh_to_helper, buf, len); | 608 | (void)GNUNET_DISK_file_write(helper_handle->fh_to_helper, buf, len); |
591 | return GNUNET_YES; | 609 | return GNUNET_YES; |
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 84adcd975..d22062074 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -272,6 +272,7 @@ process_answer(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tc) { | |||
272 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)) | 272 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)) |
273 | { | 273 | { |
274 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not store to hashmap\n"); | 274 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not store to hashmap\n"); |
275 | GNUNET_free(value); | ||
275 | } | 276 | } |
276 | 277 | ||
277 | 278 | ||