[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 01/03: fix leaks
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 01/03: fix leaks |
Date: |
Sun, 30 Jun 2019 17:13:05 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit fc8fb5b0fd8109094d81ba431eee9c209bc3eebc
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jun 18 14:54:26 2019 +0200
fix leaks
---
src/lib/teah_common.c | 2 ++
src/lib/testing_api_cmd_fakebank_transfer.c | 3 +-
src/lib/testing_api_cmd_refund.c | 43 +++++++++++++++--------------
3 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/src/lib/teah_common.c b/src/lib/teah_common.c
index 8377c478..b8bea187 100644
--- a/src/lib/teah_common.c
+++ b/src/lib/teah_common.c
@@ -111,5 +111,7 @@ TALER_curl_easy_post (struct TEAH_PostContext *ctx,
void
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);
}
diff --git a/src/lib/testing_api_cmd_fakebank_transfer.c
b/src/lib/testing_api_cmd_fakebank_transfer.c
index cff16157..570dee37 100644
--- a/src/lib/testing_api_cmd_fakebank_transfer.c
+++ b/src/lib/testing_api_cmd_fakebank_transfer.c
@@ -330,6 +330,7 @@ fakebank_transfer_run (void *cls,
return;
}
priv = GNUNET_CRYPTO_eddsa_key_create_from_file (keys);
+ GNUNET_free (keys);
if (NULL == priv)
{
GNUNET_log_config_invalid
@@ -337,12 +338,12 @@ fakebank_transfer_run (void *cls,
section,
"TIP_RESERVE_PRIV_FILENAME",
"Failed to read private key");
- GNUNET_free (keys);
GNUNET_free (section);
TALER_TESTING_interpreter_fail (is);
return;
}
fts->reserve_priv.eddsa_priv = *priv;
+ GNUNET_free (section);
GNUNET_free (priv);
GNUNET_CONFIGURATION_destroy (cfg);
}
diff --git a/src/lib/testing_api_cmd_refund.c b/src/lib/testing_api_cmd_refund.c
index f6640d0f..55f329dd 100644
--- a/src/lib/testing_api_cmd_refund.c
+++ b/src/lib/testing_api_cmd_refund.c
@@ -114,10 +114,10 @@ refund_cb (void *cls,
TALER_TESTING_interpreter_fail (rs->is);
return;
}
-
TALER_TESTING_interpreter_next (rs->is);
}
+
/**
* Run the command.
*
@@ -248,6 +248,7 @@ refund_cleanup (void *cls,
GNUNET_free (rs);
}
+
/**
* Create a "refund" command.
*
@@ -275,17 +276,19 @@ TALER_TESTING_cmd_refund (const char *label,
rs->refund_amount = refund_amount;
rs->refund_fee = refund_fee;
rs->coin_reference = coin_reference;
-
- struct TALER_TESTING_Command cmd = {
- .cls = rs,
- .label = label,
- .run = &refund_run,
- .cleanup = &refund_cleanup
- };
-
- return cmd;
+ {
+ struct TALER_TESTING_Command cmd = {
+ .cls = rs,
+ .label = label,
+ .run = &refund_run,
+ .cleanup = &refund_cleanup
+ };
+
+ return cmd;
+ }
}
+
/**
* Create a "refund" command, allow to specify refund transaction
* id. Mainly used to create conflicting requests.
@@ -313,19 +316,19 @@ TALER_TESTING_cmd_refund_with_id
struct RefundState *rs;
rs = GNUNET_new (struct RefundState);
-
rs->expected_response_code = expected_response_code;
rs->refund_amount = refund_amount;
rs->refund_fee = refund_fee;
rs->coin_reference = coin_reference;
rs->refund_transaction_id = refund_transaction_id;
-
- struct TALER_TESTING_Command cmd = {
- .cls = rs,
- .label = label,
- .run = &refund_run,
- .cleanup = &refund_cleanup
- };
-
- return cmd;
+ {
+ struct TALER_TESTING_Command cmd = {
+ .cls = rs,
+ .label = label,
+ .run = &refund_run,
+ .cleanup = &refund_cleanup
+ };
+
+ return cmd;
+ }
}
--
To stop receiving notification emails like this one, please contact
address@hidden.