gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10724 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r10724 - gnunet/src/dv
Date: Wed, 31 Mar 2010 11:21:39 +0200

Author: nevans
Date: 2010-03-31 11:21:39 +0200 (Wed, 31 Mar 2010)
New Revision: 10724

Modified:
   gnunet/src/dv/dv_api.c
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/dv/test_transport_api_data.conf
Log:
coverity fixes, test case tweak

Modified: gnunet/src/dv/dv_api.c
===================================================================
--- gnunet/src/dv/dv_api.c      2010-03-31 09:20:51 UTC (rev 10723)
+++ gnunet/src/dv/dv_api.c      2010-03-31 09:21:39 UTC (rev 10724)
@@ -22,7 +22,7 @@
  * @file dv/dv_api.c
  * @brief library to access the DV service
  * @author Christian Grothoff
- * @author Not Nathan Evans
+ * @author Nathan Evans
  */
 #include "platform.h"
 #include "gnunet_bandwidth_lib.h"
@@ -379,7 +379,10 @@
   handle->receive_cls = receive_handler_cls;
 
   if (handle->client == NULL)
-    return NULL;
+    {
+      GNUNET_free(handle);
+      return NULL;
+    }
 
   GNUNET_CLIENT_receive (handle->client,
                          &handle_message_receipt,

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2010-03-31 09:20:51 UTC (rev 10723)
+++ gnunet/src/dv/gnunet-service-dv.c   2010-03-31 09:21:39 UTC (rev 10724)
@@ -714,9 +714,11 @@
       encPeerAbout = GNUNET_strdup(GNUNET_i2s(&about->identity));
       encPeerTo = GNUNET_strdup(GNUNET_i2s(&to->identity));
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                     "%s: Sending info about peer %s to directly connected 
peer %s\n",
-                     GNUNET_i2s(&my_identity),
-                     encPeerAbout, encPeerTo);
+                  "%s: Sending info about peer %s to directly connected peer 
%s\n",
+                  GNUNET_i2s(&my_identity),
+                  encPeerAbout, encPeerTo);
+      GNUNET_free(encPeerAbout);
+      GNUNET_free(encPeerTo);
 #endif
       pending_message = GNUNET_malloc(sizeof(struct PendingMessage));
       pending_message->msg = 
GNUNET_malloc(sizeof(p2p_dv_MESSAGE_NeighborInfo));
@@ -968,6 +970,7 @@
       if (cost > ctx.fisheye_depth)
         {
           /* too costly */
+          GNUNET_free(neighbor_update);
           return;
         }
       if (ctx.max_table_size <=
@@ -978,6 +981,7 @@
           if (cost > max->cost)
             {
               /* new entry most expensive, don't create */
+              GNUNET_free(neighbor_update);
               return;
             }
           if (max->cost > 0)
@@ -1008,10 +1012,9 @@
       GNUNET_CONTAINER_multihashmap_put (ctx.extended_neighbors, 
&peer->hashPubKey,
                                  neighbor,
                                  GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-
-      return;
     }
 
+  GNUNET_free(neighbor_update);
   /* Old logic to remove entry and replace, not needed now as we only want to 
remove when full
    * or when the referring peer disconnects from us.
    */

Modified: gnunet/src/dv/test_transport_api_data.conf
===================================================================
--- gnunet/src/dv/test_transport_api_data.conf  2010-03-31 09:20:51 UTC (rev 
10723)
+++ gnunet/src/dv/test_transport_api_data.conf  2010-03-31 09:21:39 UTC (rev 
10724)
@@ -2,7 +2,7 @@
 SERVICEHOME = /tmp/test-transport-api/
 DEFAULTCONFIG = test_transport_api_data.conf
 
-[transport-udp]
+[transport-tcp]
 PORT = 2094
 
 [fs]
@@ -64,7 +64,7 @@
 PORT = 2092
 
 [transport]
-plugins = udp
+plugins = tcp
 DEBUG = NO
 PREFIX = 
 ALLOW_SHUTDOWN = YES





reply via email to

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