fix leaks

This commit is contained in:
Christian Grothoff 2019-06-18 14:54:26 +02:00
parent 7c48ce6015
commit fc8fb5b0fd
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
3 changed files with 25 additions and 19 deletions

View File

@ -111,5 +111,7 @@ TALER_curl_easy_post (struct TEAH_PostContext *ctx,
void void
TALER_curl_easy_post_finished (struct TEAH_PostContext *ctx) TALER_curl_easy_post_finished (struct TEAH_PostContext *ctx)
{ {
curl_slist_free_all (ctx->headers);
ctx->headers = NULL;
GNUNET_free_non_null (ctx->json_enc); GNUNET_free_non_null (ctx->json_enc);
} }

View File

@ -330,6 +330,7 @@ fakebank_transfer_run (void *cls,
return; return;
} }
priv = GNUNET_CRYPTO_eddsa_key_create_from_file (keys); priv = GNUNET_CRYPTO_eddsa_key_create_from_file (keys);
GNUNET_free (keys);
if (NULL == priv) if (NULL == priv)
{ {
GNUNET_log_config_invalid GNUNET_log_config_invalid
@ -337,12 +338,12 @@ fakebank_transfer_run (void *cls,
section, section,
"TIP_RESERVE_PRIV_FILENAME", "TIP_RESERVE_PRIV_FILENAME",
"Failed to read private key"); "Failed to read private key");
GNUNET_free (keys);
GNUNET_free (section); GNUNET_free (section);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
return; return;
} }
fts->reserve_priv.eddsa_priv = *priv; fts->reserve_priv.eddsa_priv = *priv;
GNUNET_free (section);
GNUNET_free (priv); GNUNET_free (priv);
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
} }

View File

@ -114,10 +114,10 @@ refund_cb (void *cls,
TALER_TESTING_interpreter_fail (rs->is); TALER_TESTING_interpreter_fail (rs->is);
return; return;
} }
TALER_TESTING_interpreter_next (rs->is); TALER_TESTING_interpreter_next (rs->is);
} }
/** /**
* Run the command. * Run the command.
* *
@ -248,6 +248,7 @@ refund_cleanup (void *cls,
GNUNET_free (rs); GNUNET_free (rs);
} }
/** /**
* Create a "refund" command. * Create a "refund" command.
* *
@ -275,7 +276,7 @@ TALER_TESTING_cmd_refund (const char *label,
rs->refund_amount = refund_amount; rs->refund_amount = refund_amount;
rs->refund_fee = refund_fee; rs->refund_fee = refund_fee;
rs->coin_reference = coin_reference; rs->coin_reference = coin_reference;
{
struct TALER_TESTING_Command cmd = { struct TALER_TESTING_Command cmd = {
.cls = rs, .cls = rs,
.label = label, .label = label,
@ -285,6 +286,8 @@ TALER_TESTING_cmd_refund (const char *label,
return cmd; return cmd;
} }
}
/** /**
* Create a "refund" command, allow to specify refund transaction * Create a "refund" command, allow to specify refund transaction
@ -313,13 +316,12 @@ TALER_TESTING_cmd_refund_with_id
struct RefundState *rs; struct RefundState *rs;
rs = GNUNET_new (struct RefundState); rs = GNUNET_new (struct RefundState);
rs->expected_response_code = expected_response_code; rs->expected_response_code = expected_response_code;
rs->refund_amount = refund_amount; rs->refund_amount = refund_amount;
rs->refund_fee = refund_fee; rs->refund_fee = refund_fee;
rs->coin_reference = coin_reference; rs->coin_reference = coin_reference;
rs->refund_transaction_id = refund_transaction_id; rs->refund_transaction_id = refund_transaction_id;
{
struct TALER_TESTING_Command cmd = { struct TALER_TESTING_Command cmd = {
.cls = rs, .cls = rs,
.label = label, .label = label,
@ -329,3 +331,4 @@ TALER_TESTING_cmd_refund_with_id
return cmd; return cmd;
} }
}