[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] 276/277: avoid allocation
From: |
gnunet |
Subject: |
[taler-merchant] 276/277: avoid allocation |
Date: |
Sun, 05 Jul 2020 20:53:09 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
commit df3b47466499d0d937f3d53b259ae8efc8961aa8
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jul 4 12:42:16 2020 +0200
avoid allocation
---
src/testing/testing_api_cmd_post_reserves.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/testing/testing_api_cmd_post_reserves.c
b/src/testing/testing_api_cmd_post_reserves.c
index f25005c..eaa7e64 100644
--- a/src/testing/testing_api_cmd_post_reserves.c
+++ b/src/testing/testing_api_cmd_post_reserves.c
@@ -70,9 +70,10 @@ struct PostReservesState
/**
* Public key assigned to the reserve
*/
- struct TALER_ReservePublicKeyP *reserve_pub;
+ struct TALER_ReservePublicKeyP reserve_pub;
};
+
/**
* Callbacks of this type are used to work the result of submitting a
* POST /reserves request to a merchant
@@ -116,9 +117,7 @@ post_reserves_cb (void *cls,
"Unhandled HTTP status (%d).\n",
hr->http_status);
}
- prs->reserve_pub = GNUNET_memdup (reserve_pub,
- sizeof (struct TALER_ReservePublicKeyP));
- GNUNET_assert (NULL != prs->reserve_pub);
+ prs->reserve_pub = *reserve_pub;
TALER_TESTING_interpreter_next (prs->is);
}
@@ -141,7 +140,7 @@ post_reserves_traits (void *cls,
{
struct PostReservesState *prs = cls;
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_reserve_pub (0, prs->reserve_pub),
+ TALER_TESTING_make_trait_reserve_pub (0, &prs->reserve_pub),
TALER_TESTING_make_trait_amount_obj (0, &prs->initial_balance),
TALER_TESTING_trait_end (),
};
@@ -195,11 +194,9 @@ post_reserves_fake_run (void *cls,
struct TALER_ReservePrivateKeyP reserve_priv;
prs->is = is;
- prs->reserve_pub = GNUNET_new (struct TALER_ReservePublicKeyP);
-
GNUNET_CRYPTO_eddsa_key_create (&reserve_priv.eddsa_priv);
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv.eddsa_priv,
- &prs->reserve_pub->eddsa_pub);
+ &prs->reserve_pub.eddsa_pub);
GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:100.00",
&prs->initial_balance));
@@ -226,7 +223,6 @@ post_reserves_cleanup (void *cls,
"POST /reserves operation did not complete\n");
TALER_MERCHANT_reserves_post_cancel (prs->prh);
}
- GNUNET_free (prs->reserve_pub);
GNUNET_free (prs);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-merchant] 259/277: more docs/thorough checks for backend db & long polling for merchant get order, (continued)
- [taler-merchant] 259/277: more docs/thorough checks for backend db & long polling for merchant get order, gnunet, 2020/07/05
- [taler-merchant] 266/277: get reserve and tip testing commands use variadic args, gnunet, 2020/07/05
- [taler-merchant] 267/277: get pay-again and pay-abort working again, gnunet, 2020/07/05
- [taler-merchant] 272/277: more merchant benchmark cleanup, gnunet, 2020/07/05
- [taler-merchant] 273/277: use improved rewind API, gnunet, 2020/07/05
- [taler-merchant] 274/277: test GET /private/transfers, gnunet, 2020/07/05
- [taler-merchant] 275/277: fix compiler warnings for test_merchantdb.c, gnunet, 2020/07/05
- [taler-merchant] 268/277: improved db tests for transfers, gnunet, 2020/07/05
- [taler-merchant] 269/277: removed outdated test code, gnunet, 2020/07/05
- [taler-merchant] 271/277: some clean up of merchant benchmark code, gnunet, 2020/07/05
- [taler-merchant] 276/277: avoid allocation,
gnunet <=
- [taler-merchant] 277/277: GNUNET_free_non_null -> GNUNET_free rename, gnunet, 2020/07/05