This commit is contained in:
Christian Grothoff 2015-07-11 18:25:30 +02:00
parent 22f022eccb
commit ee7e690bff
2 changed files with 15 additions and 9 deletions

View File

@ -296,10 +296,12 @@ reload_keys_denom_iter (void *cls,
as it is possible we just retry until we succeed. */ as it is possible we just retry until we succeed. */
} }
/* FIXME: this is a VERY ugly (we obtain ownership of d2 = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation);
pointers within 'dki' here!!!) #3886 */ d2->issue = dki->issue;
d2 = GNUNET_memdup (dki, d2->denom_priv.rsa_private_key
sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation)); = 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, res = GNUNET_CONTAINER_multihashmap_put (ctx->denomkey_map,
&denom_key_hash, &denom_key_hash,
d2, d2,
@ -309,6 +311,8 @@ reload_keys_denom_iter (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Duplicate denomination key `%s'\n", "Duplicate denomination key `%s'\n",
alias); 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); GNUNET_free (d2);
return GNUNET_OK; return GNUNET_OK;
} }

View File

@ -270,6 +270,7 @@ denomkeys_iterate_keydir_iter (void *cls,
{ {
struct DenomkeysIterateContext *dic = cls; struct DenomkeysIterateContext *dic = cls;
struct TALER_MINTDB_DenominationKeyIssueInformation issue; struct TALER_MINTDB_DenominationKeyIssueInformation issue;
int ret;
memset (&issue, 0, sizeof (issue)); memset (&issue, 0, sizeof (issue));
if (GNUNET_OK != if (GNUNET_OK !=
@ -281,11 +282,12 @@ denomkeys_iterate_keydir_iter (void *cls,
filename); filename);
return GNUNET_OK; return GNUNET_OK;
} }
/* FIXME: very ugly, 'it' is to free memory WE ret = dic->it (dic->it_cls,
allocated as part of issue!!?? #3886 */ dic->alias,
return dic->it (dic->it_cls, &issue);
dic->alias, GNUNET_CRYPTO_rsa_private_key_free (issue.denom_priv.rsa_private_key);
&issue); GNUNET_CRYPTO_rsa_public_key_free (issue.denom_pub.rsa_public_key);
return ret;
} }