gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20382 - gnunet/src/peerinfo-tool


From: gnunet
Subject: [GNUnet-SVN] r20382 - gnunet/src/peerinfo-tool
Date: Thu, 8 Mar 2012 19:22:51 +0100

Author: grothoff
Date: 2012-03-08 19:22:51 +0100 (Thu, 08 Mar 2012)
New Revision: 20382

Modified:
   gnunet/src/peerinfo-tool/gnunet-peerinfo.c
Log:
-fixeS

Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2012-03-08 18:19:03 UTC (rev 
20381)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2012-03-08 18:22:51 UTC (rev 
20382)
@@ -270,11 +270,12 @@
       return;
   }
   pc->peer = *peer;
-  GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &count_address, pc);
-  GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &compose_uri, pc);
+  if (NULL != hello)
+  {
+    GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &count_address, pc);
+    GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &compose_uri, pc);
+  }
   printf ("%s\n", pc->uri);
-  GNUNET_free (pc->uri);
-  GNUNET_free (pc);
 }
 
 struct GNUNET_PEERINFO_HelloAddressParsingContext
@@ -473,6 +474,7 @@
 
   /* WARNING: this adds the address from URI WITHOUT verification! */
   GNUNET_PEERINFO_add_peer (peerinfo, hello);
+  GNUNET_free (hello);
 }
 
 static struct GNUNET_TIME_Relative
@@ -598,6 +600,7 @@
       struct PrintContext *pc;
       char *pkey;
       ssize_t l, pl;
+
       pc = GNUNET_malloc (sizeof (struct PrintContext));
       pkey = GNUNET_CRYPTO_rsa_public_key_to_string (&pub);
       pl = strlen ("gnunet://hello/");
@@ -609,6 +612,8 @@
       GNUNET_PEERINFO_iterate (peerinfo, &pid,
           GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
           print_my_uri, pc);
+      GNUNET_free (pc->uri);
+      GNUNET_free (pc);
     }
   }
 }




reply via email to

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