aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mint/taler-mint-httpd_keystate.c12
-rw-r--r--src/mintdb/mintdb_keyio.c12
2 files changed, 15 insertions, 9 deletions
diff --git a/src/mint/taler-mint-httpd_keystate.c b/src/mint/taler-mint-httpd_keystate.c
index e1509a60..0d4fc40e 100644
--- a/src/mint/taler-mint-httpd_keystate.c
+++ b/src/mint/taler-mint-httpd_keystate.c
@@ -296,10 +296,12 @@ reload_keys_denom_iter (void *cls,
as it is possible we just retry until we succeed. */
}
- /* FIXME: this is a VERY ugly (we obtain ownership of
- pointers within 'dki' here!!!) #3886 */
- d2 = GNUNET_memdup (dki,
- sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation));
+ d2 = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation);
+ d2->issue = dki->issue;
+ d2->denom_priv.rsa_private_key
+ = GNUNET_CRYPTO_rsa_private_key_dup (dki->denom_priv.rsa_private_key);
+ d2->denom_pub.rsa_public_key
+ = GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key);
res = GNUNET_CONTAINER_multihashmap_put (ctx->denomkey_map,
&denom_key_hash,
d2,
@@ -309,6 +311,8 @@ reload_keys_denom_iter (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Duplicate denomination key `%s'\n",
alias);
+ GNUNET_CRYPTO_rsa_private_key_free (d2->denom_priv.rsa_private_key);
+ GNUNET_CRYPTO_rsa_public_key_free (d2->denom_pub.rsa_public_key);
GNUNET_free (d2);
return GNUNET_OK;
}
diff --git a/src/mintdb/mintdb_keyio.c b/src/mintdb/mintdb_keyio.c
index 9e2cd60f..7cf77558 100644
--- a/src/mintdb/mintdb_keyio.c
+++ b/src/mintdb/mintdb_keyio.c
@@ -270,6 +270,7 @@ denomkeys_iterate_keydir_iter (void *cls,
{
struct DenomkeysIterateContext *dic = cls;
struct TALER_MINTDB_DenominationKeyIssueInformation issue;
+ int ret;
memset (&issue, 0, sizeof (issue));
if (GNUNET_OK !=
@@ -281,11 +282,12 @@ denomkeys_iterate_keydir_iter (void *cls,
filename);
return GNUNET_OK;
}
- /* FIXME: very ugly, 'it' is to free memory WE
- allocated as part of issue!!?? #3886 */
- return dic->it (dic->it_cls,
- dic->alias,
- &issue);
+ ret = dic->it (dic->it_cls,
+ dic->alias,
+ &issue);
+ GNUNET_CRYPTO_rsa_private_key_free (issue.denom_priv.rsa_private_key);
+ GNUNET_CRYPTO_rsa_public_key_free (issue.denom_pub.rsa_public_key);
+ return ret;
}