summaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-service-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-17 08:01:38 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-17 08:01:38 +0000
commitad3086c0d4083f4a499936bf6e043edcfc1627c4 (patch)
tree3425d524243f4d0de23d83c6dd18b93561f2af1c /src/namestore/gnunet-service-namestore.c
parent2a0feb1324e62faaec9392d177a1cb6098591555 (diff)
downloadgnunet-ad3086c0d4083f4a499936bf6e043edcfc1627c4.tar.gz
gnunet-ad3086c0d4083f4a499936bf6e043edcfc1627c4.zip
-fix use after free, cancel of dead task
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r--src/namestore/gnunet-service-namestore.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 9c91e1975..e98fe30db 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -526,6 +526,7 @@ refresh_block (struct GNUNET_SERVER_Client *client,
526{ 526{
527 struct GNUNET_GNSRECORD_Block *block; 527 struct GNUNET_GNSRECORD_Block *block;
528 struct CacheOperation *cop; 528 struct CacheOperation *cop;
529 struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
529 530
530 if (0 == rd_count) 531 if (0 == rd_count)
531 block = GNUNET_GNSRECORD_block_create (zone_key, 532 block = GNUNET_GNSRECORD_block_create (zone_key,
@@ -538,8 +539,12 @@ refresh_block (struct GNUNET_SERVER_Client *client,
538 rd), 539 rd),
539 name, 540 name,
540 rd, rd_count); 541 rd, rd_count);
542 GNUNET_CRYPTO_ecdsa_key_get_public (zone_key,
543 &pkey);
541 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 544 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
542 "Caching block in namecache\n"); 545 "Caching block for label `%s' in zone `%s' in namecache\n",
546 name,
547 GNUNET_GNSRECORD_z2s (&pkey));
543 cop = GNUNET_new (struct CacheOperation); 548 cop = GNUNET_new (struct CacheOperation);
544 cop->client = client; 549 cop->client = client;
545 cop->rid = rid; 550 cop->rid = rid;
@@ -675,7 +680,6 @@ handle_record_store (void *cls,
675 conv_name, 680 conv_name,
676 rd_count, rd); 681 rd_count, rd);
677 } 682 }
678 GNUNET_free (conv_name);
679 } 683 }
680 if (GNUNET_OK == res) 684 if (GNUNET_OK == res)
681 { 685 {
@@ -684,8 +688,10 @@ handle_record_store (void *cls,
684 conv_name, 688 conv_name,
685 rd_count, rd); 689 rd_count, rd);
686 GNUNET_SERVER_receive_done (client, GNUNET_OK); 690 GNUNET_SERVER_receive_done (client, GNUNET_OK);
691 GNUNET_free (conv_name);
687 return; 692 return;
688 } 693 }
694 GNUNET_free (conv_name);
689 } 695 }
690 send_store_response (client, res, rid); 696 send_store_response (client, res, rid);
691 GNUNET_SERVER_receive_done (client, GNUNET_OK); 697 GNUNET_SERVER_receive_done (client, GNUNET_OK);