gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10062 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r10062 - gnunet/src/transport
Date: Tue, 19 Jan 2010 15:33:36 +0100

Author: nevans
Date: 2010-01-19 15:33:36 +0100 (Tue, 19 Jan 2010)
New Revision: 10062

Modified:
   gnunet/src/transport/plugin_transport_udp.c
Log:
fix memory leaks

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2010-01-19 14:20:54 UTC (rev 
10061)
+++ gnunet/src/transport/plugin_transport_udp.c 2010-01-19 14:33:36 UTC (rev 
10062)
@@ -361,7 +361,7 @@
       else
         cont (cont_cls, target, GNUNET_OK);
     }
-
+  GNUNET_free(message);
   return;
 }
 
@@ -404,6 +404,7 @@
                        &pong->header,
                        GNUNET_TIME_relative_multiply
                        (GNUNET_TIME_UNIT_SECONDS, 30), NULL, NULL);
+      GNUNET_free(pong);
     }
 
   return;
@@ -557,7 +558,7 @@
         {
           handle_udp_pong (plugin, sender, hdr);
         }
-
+      GNUNET_free(sender);
       GNUNET_free (buf);
 
     }
@@ -712,6 +713,7 @@
   udp_plugin_send (plugin, target, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
                    &msg->header, timeout, NULL, NULL);
 
+  GNUNET_free(msg);
   return GNUNET_OK;
 }
 
@@ -864,6 +866,8 @@
 {
   struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
   struct Plugin *plugin = api->cls;
+  struct Session *pos;
+  struct Session *oldpos;
 
   udp_transport_server_stop (plugin);
   if (NULL != hostname_dns)
@@ -872,6 +876,17 @@
       hostname_dns = NULL;
     }
   GNUNET_SERVICE_stop (plugin->service);
+
+  pos = plugin->sessions;
+  while (pos != NULL)
+    {
+      GNUNET_free(pos->connect_addr);
+      oldpos = pos;
+      pos = pos->next;
+      GNUNET_free(oldpos);
+    }
+
+  GNUNET_NETWORK_fdset_destroy(plugin->rs);
   GNUNET_free (plugin);
   GNUNET_free (api);
   return NULL;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]