fix leaks and bad RC logic wrt json reference copying
This commit is contained in:
parent
677654f609
commit
eb32dd626a
@ -239,6 +239,7 @@ handle_refresh_reveal_finished (void *cls,
|
|||||||
for (unsigned int i = 0; i<rrh->md->num_fresh_coins; i++)
|
for (unsigned int i = 0; i<rrh->md->num_fresh_coins; i++)
|
||||||
if (NULL != sigs[i].rsa_signature)
|
if (NULL != sigs[i].rsa_signature)
|
||||||
GNUNET_CRYPTO_rsa_signature_free (sigs[i].rsa_signature);
|
GNUNET_CRYPTO_rsa_signature_free (sigs[i].rsa_signature);
|
||||||
|
TALER_EXCHANGE_refreshes_reveal_cancel (rrh);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case MHD_HTTP_BAD_REQUEST:
|
case MHD_HTTP_BAD_REQUEST:
|
||||||
|
@ -294,9 +294,8 @@ deposit_run (void *cls,
|
|||||||
const struct TALER_TESTING_Command *cmd;
|
const struct TALER_TESTING_Command *cmd;
|
||||||
struct DepositState *ods;
|
struct DepositState *ods;
|
||||||
|
|
||||||
cmd = TALER_TESTING_interpreter_lookup_command
|
cmd = TALER_TESTING_interpreter_lookup_command (is,
|
||||||
(is,
|
ds->deposit_reference);
|
||||||
ds->deposit_reference);
|
|
||||||
if (NULL == cmd)
|
if (NULL == cmd)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -306,8 +305,8 @@ deposit_run (void *cls,
|
|||||||
ods = cmd->cls;
|
ods = cmd->cls;
|
||||||
ds->coin_reference = ods->coin_reference;
|
ds->coin_reference = ods->coin_reference;
|
||||||
ds->coin_index = ods->coin_index;
|
ds->coin_index = ods->coin_index;
|
||||||
ds->wire_details = ods->wire_details;
|
ds->wire_details = json_incref (ods->wire_details);
|
||||||
ds->contract_terms = ods->contract_terms;
|
ds->contract_terms = json_incref (ods->contract_terms);
|
||||||
ds->timestamp = ods->timestamp;
|
ds->timestamp = ods->timestamp;
|
||||||
ds->refund_deadline = ods->refund_deadline;
|
ds->refund_deadline = ods->refund_deadline;
|
||||||
ds->amount = ods->amount;
|
ds->amount = ods->amount;
|
||||||
@ -319,9 +318,9 @@ deposit_run (void *cls,
|
|||||||
/* We're copying the merchant key from another deposit operation */
|
/* We're copying the merchant key from another deposit operation */
|
||||||
const struct TALER_MerchantPrivateKeyP *merchant_priv;
|
const struct TALER_MerchantPrivateKeyP *merchant_priv;
|
||||||
const struct TALER_TESTING_Command *cmd;
|
const struct TALER_TESTING_Command *cmd;
|
||||||
cmd = TALER_TESTING_interpreter_lookup_command
|
|
||||||
(is,
|
cmd = TALER_TESTING_interpreter_lookup_command (is,
|
||||||
ds->merchant_priv_reference);
|
ds->merchant_priv_reference);
|
||||||
if (NULL == cmd)
|
if (NULL == cmd)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -340,9 +339,8 @@ deposit_run (void *cls,
|
|||||||
ds->merchant_priv = *merchant_priv;
|
ds->merchant_priv = *merchant_priv;
|
||||||
}
|
}
|
||||||
GNUNET_assert (ds->coin_reference);
|
GNUNET_assert (ds->coin_reference);
|
||||||
coin_cmd = TALER_TESTING_interpreter_lookup_command
|
coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
|
||||||
(is,
|
ds->coin_reference);
|
||||||
ds->coin_reference);
|
|
||||||
if (NULL == coin_cmd)
|
if (NULL == coin_cmd)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -743,6 +741,7 @@ TALER_TESTING_cmd_deposit_replay (const char *label,
|
|||||||
unsigned int expected_response_code)
|
unsigned int expected_response_code)
|
||||||
{
|
{
|
||||||
struct DepositState *ds;
|
struct DepositState *ds;
|
||||||
|
|
||||||
ds = GNUNET_new (struct DepositState);
|
ds = GNUNET_new (struct DepositState);
|
||||||
ds->deposit_reference = deposit_reference;
|
ds->deposit_reference = deposit_reference;
|
||||||
ds->expected_response_code = expected_response_code;
|
ds->expected_response_code = expected_response_code;
|
||||||
|
@ -459,9 +459,8 @@ refresh_reveal_run (void *cls,
|
|||||||
const struct TALER_TESTING_Command *melt_cmd;
|
const struct TALER_TESTING_Command *melt_cmd;
|
||||||
|
|
||||||
rrs->is = is;
|
rrs->is = is;
|
||||||
melt_cmd = TALER_TESTING_interpreter_lookup_command
|
melt_cmd = TALER_TESTING_interpreter_lookup_command (is,
|
||||||
(is, rrs->melt_reference);
|
rrs->melt_reference);
|
||||||
|
|
||||||
if (NULL == melt_cmd)
|
if (NULL == melt_cmd)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -469,12 +468,12 @@ refresh_reveal_run (void *cls,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rms = melt_cmd->cls;
|
rms = melt_cmd->cls;
|
||||||
rrs->rrh = TALER_EXCHANGE_refreshes_reveal
|
rrs->rrh = TALER_EXCHANGE_refreshes_reveal (is->exchange,
|
||||||
(is->exchange,
|
rms->refresh_data_length,
|
||||||
rms->refresh_data_length,
|
rms->refresh_data,
|
||||||
rms->refresh_data,
|
rms->noreveal_index,
|
||||||
rms->noreveal_index,
|
&reveal_cb,
|
||||||
&reveal_cb, rrs);
|
rrs);
|
||||||
|
|
||||||
if (NULL == rrs->rrh)
|
if (NULL == rrs->rrh)
|
||||||
{
|
{
|
||||||
@ -504,7 +503,6 @@ refresh_reveal_cleanup (void *cls,
|
|||||||
"Command %u (%s) did not complete\n",
|
"Command %u (%s) did not complete\n",
|
||||||
rrs->is->ip,
|
rrs->is->ip,
|
||||||
cmd->label);
|
cmd->label);
|
||||||
|
|
||||||
TALER_EXCHANGE_refreshes_reveal_cancel (rrs->rrh);
|
TALER_EXCHANGE_refreshes_reveal_cancel (rrs->rrh);
|
||||||
rrs->rrh = NULL;
|
rrs->rrh = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user