aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_to_name.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-11 21:43:28 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-11 21:43:34 +0200
commit90ff9edfa9c5fcfa3a36d1653ff105e89b888e21 (patch)
tree780a2071f5072c8e8e044db741eb295c3f3ea2a7 /src/namestore/test_namestore_api_zone_to_name.c
parent3bcfe59f1ce533246bda271f00b3ee957cae304d (diff)
downloadgnunet-90ff9edfa9c5fcfa3a36d1653ff105e89b888e21.tar.gz
gnunet-90ff9edfa9c5fcfa3a36d1653ff105e89b888e21.zip
fixing #6149
Diffstat (limited to 'src/namestore/test_namestore_api_zone_to_name.c')
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 65366e267..94cc5c285 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -42,7 +42,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
42 42
43static struct GNUNET_SCHEDULER_Task *endbadly_task; 43static struct GNUNET_SCHEDULER_Task *endbadly_task;
44 44
45static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 45static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey;
46 46
47static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 47static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
48 48
@@ -82,11 +82,6 @@ end (void *cls)
82 GNUNET_SCHEDULER_cancel (endbadly_task); 82 GNUNET_SCHEDULER_cancel (endbadly_task);
83 endbadly_task = NULL; 83 endbadly_task = NULL;
84 } 84 }
85 if (NULL != privkey)
86 {
87 GNUNET_free (privkey);
88 privkey = NULL;
89 }
90 if (NULL != nsh) 85 if (NULL != nsh)
91 { 86 {
92 GNUNET_NAMESTORE_disconnect (nsh); 87 GNUNET_NAMESTORE_disconnect (nsh);
@@ -133,7 +128,7 @@ zone_to_name_proc (void *cls,
133 } 128 }
134 if ((NULL == zone_key) || 129 if ((NULL == zone_key) ||
135 (0 != GNUNET_memcmp (zone_key, 130 (0 != GNUNET_memcmp (zone_key,
136 privkey))) 131 &privkey)))
137 { 132 {
138 fail = GNUNET_YES; 133 fail = GNUNET_YES;
139 GNUNET_break (0); 134 GNUNET_break (0);
@@ -176,7 +171,7 @@ put_cont (void *cls,
176 res = 0; 171 res = 0;
177 172
178 qe = GNUNET_NAMESTORE_zone_to_name (nsh, 173 qe = GNUNET_NAMESTORE_zone_to_name (nsh,
179 privkey, 174 &privkey,
180 &s_zone_value, 175 &s_zone_value,
181 &error_cb, 176 &error_cb,
182 NULL, 177 NULL,
@@ -208,10 +203,9 @@ run (void *cls,
208 GNUNET_SCHEDULER_add_shutdown (&end, 203 GNUNET_SCHEDULER_add_shutdown (&end,
209 NULL); 204 NULL);
210 GNUNET_asprintf (&s_name, "dummy"); 205 GNUNET_asprintf (&s_name, "dummy");
211 privkey = GNUNET_CRYPTO_ecdsa_key_create (); 206 GNUNET_CRYPTO_ecdsa_key_create (&privkey);
212 GNUNET_assert (NULL != privkey);
213 /* get public key */ 207 /* get public key */
214 GNUNET_CRYPTO_ecdsa_key_get_public (privkey, 208 GNUNET_CRYPTO_ecdsa_key_get_public (&privkey,
215 &pubkey); 209 &pubkey);
216 210
217 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, 211 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -229,7 +223,7 @@ run (void *cls,
229 nsh = GNUNET_NAMESTORE_connect (cfg); 223 nsh = GNUNET_NAMESTORE_connect (cfg);
230 GNUNET_break (NULL != nsh); 224 GNUNET_break (NULL != nsh);
231 GNUNET_NAMESTORE_records_store (nsh, 225 GNUNET_NAMESTORE_records_store (nsh,
232 privkey, 226 &privkey,
233 s_name, 227 s_name,
234 1, 228 1,
235 &rd, 229 &rd,