aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-08 18:22:51 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-08 18:22:51 +0000
commitc994440afa42fb43c70f173076539ac040a33378 (patch)
treec5a9dd4c35443162c9a7d3a9b4b4b8e574822bd7 /src/peerinfo-tool
parentaea1b77fa339d991144fe8a223b4062ffd85de7b (diff)
downloadgnunet-c994440afa42fb43c70f173076539ac040a33378.tar.gz
gnunet-c994440afa42fb43c70f173076539ac040a33378.zip
-fixeS
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index d89682d1c..41bc3a43a 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -270,11 +270,12 @@ print_my_uri (void *cls, const struct GNUNET_PeerIdentity *peer,
270 return; 270 return;
271 } 271 }
272 pc->peer = *peer; 272 pc->peer = *peer;
273 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &count_address, pc); 273 if (NULL != hello)
274 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &compose_uri, pc); 274 {
275 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &count_address, pc);
276 GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, &compose_uri, pc);
277 }
275 printf ("%s\n", pc->uri); 278 printf ("%s\n", pc->uri);
276 GNUNET_free (pc->uri);
277 GNUNET_free (pc);
278} 279}
279 280
280struct GNUNET_PEERINFO_HelloAddressParsingContext 281struct GNUNET_PEERINFO_HelloAddressParsingContext
@@ -473,6 +474,7 @@ parse_hello (const struct GNUNET_CONFIGURATION_Handle *c,
473 474
474 /* WARNING: this adds the address from URI WITHOUT verification! */ 475 /* WARNING: this adds the address from URI WITHOUT verification! */
475 GNUNET_PEERINFO_add_peer (peerinfo, hello); 476 GNUNET_PEERINFO_add_peer (peerinfo, hello);
477 GNUNET_free (hello);
476} 478}
477 479
478static struct GNUNET_TIME_Relative 480static struct GNUNET_TIME_Relative
@@ -598,6 +600,7 @@ run (void *cls, char *const *args, const char *cfgfile,
598 struct PrintContext *pc; 600 struct PrintContext *pc;
599 char *pkey; 601 char *pkey;
600 ssize_t l, pl; 602 ssize_t l, pl;
603
601 pc = GNUNET_malloc (sizeof (struct PrintContext)); 604 pc = GNUNET_malloc (sizeof (struct PrintContext));
602 pkey = GNUNET_CRYPTO_rsa_public_key_to_string (&pub); 605 pkey = GNUNET_CRYPTO_rsa_public_key_to_string (&pub);
603 pl = strlen ("gnunet://hello/"); 606 pl = strlen ("gnunet://hello/");
@@ -609,6 +612,8 @@ run (void *cls, char *const *args, const char *cfgfile,
609 GNUNET_PEERINFO_iterate (peerinfo, &pid, 612 GNUNET_PEERINFO_iterate (peerinfo, &pid,
610 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), 613 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
611 print_my_uri, pc); 614 print_my_uri, pc);
615 GNUNET_free (pc->uri);
616 GNUNET_free (pc);
612 } 617 }
613 } 618 }
614} 619}