From 56e49b44a00454606f055cfdb362d976547bf64d Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 14 Jan 2014 15:21:04 +0000 Subject: [PATCH] fixing memory leaks --- src/transport/plugin_transport_http_server.c | 2 ++ src/transport/plugin_transport_wlan.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index bdc1074ed..53ee27005 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -1144,6 +1144,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, else { /* create new session */ + addr = NULL; switch (conn_info->client_addr->sa_family) { case (AF_INET): @@ -1185,6 +1186,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, http_common_plugin_address_to_string (NULL, plugin->protocol, addr, addr_len)); + GNUNET_free_non_null (addr); } sc = GNUNET_new (struct ServerConnection); if (conn_info->client_addr->sa_family == AF_INET) diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 1026eb584..103d21ae1 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -1037,6 +1037,7 @@ free_macendpoint (struct MacEndpoint *endpoint) GNUNET_SCHEDULER_cancel (endpoint->timeout_task); endpoint->timeout_task = GNUNET_SCHEDULER_NO_TASK; } + GNUNET_HELLO_address_free (endpoint->address); GNUNET_free (endpoint); } @@ -1556,7 +1557,9 @@ handle_helper_message (void *cls, void *client, mac_to_string (&rxinfo->frame.addr2)); wa.mac = rxinfo->frame.addr2; wa.options = htonl (0); - address = GNUNET_HELLO_address_allocate (NULL, PLUGIN_NAME, &wa, + struct GNUNET_PeerIdentity dummy; + memset (&dummy, '\0', sizeof (dummy)); + address = GNUNET_HELLO_address_allocate (&dummy, PLUGIN_NAME, &wa, sizeof (struct WlanAddress), GNUNET_HELLO_ADDRESS_INFO_NONE); mas.endpoint = create_macendpoint (plugin, address); GNUNET_HELLO_address_free (address); -- 2.25.1