aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/benchmark/taler-aggregator-benchmark.c3
-rw-r--r--src/exchange-tools/taler-crypto-worker.c22
-rw-r--r--src/exchange/taler-exchange-httpd_batch-withdraw.c5
-rw-r--r--src/exchange/taler-exchange-httpd_purses_create.c23
-rw-r--r--src/exchange/taler-exchange-httpd_purses_merge.c10
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_history.c18
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_purse.c18
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c5
-rw-r--r--src/include/taler_exchange_service.h1
-rw-r--r--src/lib/exchange_api_auditor_add_denomination.c13
-rw-r--r--src/lib/exchange_api_batch_withdraw2.c5
-rw-r--r--src/lib/exchange_api_management_auditor_disable.c13
-rw-r--r--src/lib/exchange_api_management_auditor_enable.c13
-rw-r--r--src/lib/exchange_api_management_post_extensions.c19
-rw-r--r--src/lib/exchange_api_management_post_keys.c13
-rw-r--r--src/lib/exchange_api_management_revoke_denomination_key.c12
-rw-r--r--src/lib/exchange_api_management_revoke_signing_key.c13
-rw-r--r--src/lib/exchange_api_management_set_global_fee.c13
-rw-r--r--src/lib/exchange_api_management_set_wire_fee.c13
-rw-r--r--src/lib/exchange_api_management_wire_disable.c13
-rw-r--r--src/lib/exchange_api_management_wire_enable.c13
-rw-r--r--src/lib/exchange_api_purse_create_with_merge.c6
-rw-r--r--src/testing/testing_api_cmd_purse_merge.c6
-rw-r--r--src/util/taler-exchange-secmod-cs.c2
-rw-r--r--src/util/taler-exchange-secmod-eddsa.c2
-rw-r--r--src/util/taler-exchange-secmod-rsa.c5
26 files changed, 173 insertions, 106 deletions
diff --git a/src/benchmark/taler-aggregator-benchmark.c b/src/benchmark/taler-aggregator-benchmark.c
index 7748f583d..665077bed 100644
--- a/src/benchmark/taler-aggregator-benchmark.c
+++ b/src/benchmark/taler-aggregator-benchmark.c
@@ -283,6 +283,9 @@ add_deposit (const struct Merchant *m)
d.coin.denom_pub_hash = h_denom_pub;
d.coin.denom_sig = denom_sig;
RANDOMIZE (&d.h_contract_terms);
+ memset (&d.coin.h_age_commitment,
+ 0,
+ sizeof (d.coin.h_age_commitment));
if (0 >=
plugin->ensure_coin_known (plugin->cls,
diff --git a/src/exchange-tools/taler-crypto-worker.c b/src/exchange-tools/taler-crypto-worker.c
index d5ba4feec..a1db1e812 100644
--- a/src/exchange-tools/taler-crypto-worker.c
+++ b/src/exchange-tools/taler-crypto-worker.c
@@ -270,25 +270,27 @@ run (void *cls,
&msg_size),
GNUNET_JSON_spec_end ()
};
- if (GNUNET_OK != GNUNET_JSON_parse (args,
- eddsa_sign_spec,
- NULL,
- NULL))
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (args,
+ eddsa_sign_spec,
+ NULL,
+ NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"malformed op args\n");
global_ret = 1;
return;
}
- GNUNET_CRYPTO_eddsa_sign_ (
- &priv,
- msg,
- &sig
- );
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CRYPTO_eddsa_sign_ (
+ &priv,
+ msg,
+ &sig));
resp = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("sig", &sig)
);
- json_dumpf (resp, stdout, JSON_COMPACT);
+ json_dumpf (resp, stdout,
+ JSON_COMPACT);
printf ("\n");
fflush (stdout);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/exchange/taler-exchange-httpd_batch-withdraw.c b/src/exchange/taler-exchange-httpd_batch-withdraw.c
index 52f420369..91d1ebd3b 100644
--- a/src/exchange/taler-exchange-httpd_batch-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_batch-withdraw.c
@@ -628,8 +628,9 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc,
memset (&wc,
0,
sizeof (wc));
- TALER_amount_set_zero (TEH_currency,
- &wc.batch_total);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (TEH_currency,
+ &wc.batch_total));
wc.reserve_pub = reserve_pub;
{
diff --git a/src/exchange/taler-exchange-httpd_purses_create.c b/src/exchange/taler-exchange-httpd_purses_create.c
index d6c942c65..cc5478d17 100644
--- a/src/exchange/taler-exchange-httpd_purses_create.c
+++ b/src/exchange/taler-exchange-httpd_purses_create.c
@@ -207,8 +207,9 @@ create_transaction (void *cls,
struct TALER_Amount purse_fee;
bool in_conflict = true;
- TALER_amount_set_zero (pcc->amount.currency,
- &purse_fee);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (pcc->amount.currency,
+ &purse_fee));
/* 1) create purse */
qs = TEH_plugin->insert_purse_request (
TEH_plugin->cls,
@@ -739,8 +740,22 @@ TEH_handler_purses_create (
TALER_EC_GENERIC_PARAMETER_MALFORMED,
"deposits");
}
- gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (),
- pcc.exchange_timestamp);
+ {
+ struct TEH_KeyStateHandle *keys;
+
+ keys = TEH_keys_get_state ();
+ if (NULL == keys)
+ {
+ GNUNET_break (0);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
+ NULL);
+ }
+ gf = TEH_keys_global_fee_by_time (keys,
+ pcc.exchange_timestamp);
+ }
if (NULL == gf)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
diff --git a/src/exchange/taler-exchange-httpd_purses_merge.c b/src/exchange/taler-exchange-httpd_purses_merge.c
index 5f09f1983..144571d22 100644
--- a/src/exchange/taler-exchange-httpd_purses_merge.c
+++ b/src/exchange/taler-exchange-httpd_purses_merge.c
@@ -162,8 +162,9 @@ reply_merge_success (struct MHD_Connection *connection,
&pcc->target_amount,
&pcc->wf->wad))
{
- TALER_amount_set_zero (TEH_currency,
- &merge_amount);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (TEH_currency,
+ &merge_amount));
}
}
if (TALER_EC_NONE !=
@@ -524,8 +525,9 @@ TEH_handler_purses_merge (
{
struct TALER_Amount zero_purse_fee;
- TALER_amount_set_zero (pcc.target_amount.currency,
- &zero_purse_fee);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (pcc.target_amount.currency,
+ &zero_purse_fee));
if (GNUNET_OK !=
TALER_wallet_account_merge_verify (
pcc.merge_timestamp,
diff --git a/src/exchange/taler-exchange-httpd_reserves_history.c b/src/exchange/taler-exchange-httpd_reserves_history.c
index 4766dadc8..1392dfc5a 100644
--- a/src/exchange/taler-exchange-httpd_reserves_history.c
+++ b/src/exchange/taler-exchange-httpd_reserves_history.c
@@ -232,8 +232,22 @@ TEH_handler_reserves_history (struct TEH_RequestContext *rc,
TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW,
NULL);
}
- rsc.gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (),
- rsc.timestamp);
+ {
+ struct TEH_KeyStateHandle *keys;
+
+ keys = TEH_keys_get_state ();
+ if (NULL == keys)
+ {
+ GNUNET_break (0);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
+ NULL);
+ }
+ rsc.gf = TEH_keys_global_fee_by_time (keys,
+ rsc.timestamp);
+ }
if (NULL == rsc.gf)
{
GNUNET_break (0);
diff --git a/src/exchange/taler-exchange-httpd_reserves_purse.c b/src/exchange/taler-exchange-httpd_reserves_purse.c
index 7aa00a500..fcf688d42 100644
--- a/src/exchange/taler-exchange-httpd_reserves_purse.c
+++ b/src/exchange/taler-exchange-httpd_reserves_purse.c
@@ -557,8 +557,22 @@ TEH_handler_reserves_purse (
TALER_EC_EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER,
NULL);
}
- rpc.gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (),
- rpc.exchange_timestamp);
+ {
+ struct TEH_KeyStateHandle *keys;
+
+ keys = TEH_keys_get_state ();
+ if (NULL == keys)
+ {
+ GNUNET_break (0);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
+ NULL);
+ }
+ rpc.gf = TEH_keys_global_fee_by_time (keys,
+ rpc.exchange_timestamp);
+ }
if (NULL == rpc.gf)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 0dbd804bb..e933bfcfd 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -14594,8 +14594,9 @@ postgres_do_reserve_purse (
GNUNET_PQ_result_spec_end
};
- TALER_amount_set_zero (pg->currency,
- &zero_fee);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (pg->currency,
+ &zero_fee));
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"call_reserve_purse",
params,
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 03223edc7..2d801245b 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -423,7 +423,6 @@ struct TALER_EXCHANGE_HttpResponse
* reply (too big, invalid JSON).
*/
const json_t *reply;
-
/**
* Set to the human-readable 'hint' that is optionally
* provided by the exchange together with errors. NULL
diff --git a/src/lib/exchange_api_auditor_add_denomination.c b/src/lib/exchange_api_auditor_add_denomination.c
index d01252a83..71f421d4d 100644
--- a/src/lib/exchange_api_auditor_add_denomination.c
+++ b/src/lib/exchange_api_auditor_add_denomination.c
@@ -192,16 +192,17 @@ TALER_EXCHANGE_add_auditor_denomination (
GNUNET_JSON_pack_data_auto ("auditor_sig",
auditor_sig));
eh = TALER_AUDITOR_curl_easy_get_ (ah->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&ah->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&ah->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (ah->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_batch_withdraw2.c b/src/lib/exchange_api_batch_withdraw2.c
index 52da9b401..e9da21992 100644
--- a/src/lib/exchange_api_batch_withdraw2.c
+++ b/src/lib/exchange_api_batch_withdraw2.c
@@ -414,8 +414,9 @@ TALER_EXCHANGE_batch_withdraw2 (
wh->cb = res_cb;
wh->cb_cls = res_cb_cls;
wh->num_coins = pds_length;
- TALER_amount_set_zero (keys->currency,
- &wh->requested_amount);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (keys->currency,
+ &wh->requested_amount));
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
&wh->reserve_pub.eddsa_pub);
{
diff --git a/src/lib/exchange_api_management_auditor_disable.c b/src/lib/exchange_api_management_auditor_disable.c
index bfe60ee79..b1de80f0e 100644
--- a/src/lib/exchange_api_management_auditor_disable.c
+++ b/src/lib/exchange_api_management_auditor_disable.c
@@ -173,16 +173,17 @@ TALER_EXCHANGE_management_disable_auditor (
GNUNET_JSON_pack_timestamp ("validity_end",
validity_end));
eh = TALER_EXCHANGE_curl_easy_get_ (ah->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&ah->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&ah->post_ctx,
+ eh,
+ body)))
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (ah->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_auditor_enable.c b/src/lib/exchange_api_management_auditor_enable.c
index a99449307..af75215ec 100644
--- a/src/lib/exchange_api_management_auditor_enable.c
+++ b/src/lib/exchange_api_management_auditor_enable.c
@@ -163,16 +163,17 @@ TALER_EXCHANGE_management_enable_auditor (
GNUNET_JSON_pack_timestamp ("validity_start",
validity_start));
eh = TALER_EXCHANGE_curl_easy_get_ (ah->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&ah->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&ah->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
json_decref (body);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
GNUNET_free (ah->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_post_extensions.c b/src/lib/exchange_api_management_post_extensions.c
index 87b0e0be8..544f85efc 100644
--- a/src/lib/exchange_api_management_post_extensions.c
+++ b/src/lib/exchange_api_management_post_extensions.c
@@ -23,6 +23,7 @@
#include "taler_json_lib.h"
#include <gnunet/gnunet_curl_lib.h>
#include "taler_extensions.h"
+#include "exchange_api_curl_defaults.h"
#include "taler_exchange_service.h"
#include "taler_signatures.h"
#include "taler_curl_lib.h"
@@ -154,26 +155,24 @@ TALER_EXCHANGE_management_post_extensions (
GNUNET_JSON_pack_data_auto ("extensions_sig",
&ped->extensions_sig));
- eh = curl_easy_init ();
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&ph->post_ctx,
- eh,
- body))
+ eh = TALER_EXCHANGE_curl_easy_get_ (ph->url);
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&ph->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (ph->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting URL '%s'\n",
ph->url);
- GNUNET_assert (CURLE_OK == curl_easy_setopt (eh,
- CURLOPT_URL,
- ph->url));
ph->job = GNUNET_CURL_job_add2 (ctx,
eh,
ph->post_ctx.headers,
diff --git a/src/lib/exchange_api_management_post_keys.c b/src/lib/exchange_api_management_post_keys.c
index d7790599a..291c0ac02 100644
--- a/src/lib/exchange_api_management_post_keys.c
+++ b/src/lib/exchange_api_management_post_keys.c
@@ -191,16 +191,17 @@ TALER_EXCHANGE_post_management_keys (
GNUNET_JSON_pack_array_steal ("signkey_sigs",
signkey_sigs));
eh = TALER_EXCHANGE_curl_easy_get_ (ph->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&ph->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&ph->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (ph->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_revoke_denomination_key.c b/src/lib/exchange_api_management_revoke_denomination_key.c
index f7ddeaed2..8d65b6451 100644
--- a/src/lib/exchange_api_management_revoke_denomination_key.c
+++ b/src/lib/exchange_api_management_revoke_denomination_key.c
@@ -175,15 +175,17 @@ TALER_EXCHANGE_management_revoke_denomination_key (
return NULL;
}
eh = TALER_EXCHANGE_curl_easy_get_ (rh->url);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&rh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&rh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (rh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_revoke_signing_key.c b/src/lib/exchange_api_management_revoke_signing_key.c
index 046d18729..aac27678f 100644
--- a/src/lib/exchange_api_management_revoke_signing_key.c
+++ b/src/lib/exchange_api_management_revoke_signing_key.c
@@ -165,16 +165,17 @@ TALER_EXCHANGE_management_revoke_signing_key (
GNUNET_JSON_pack_data_auto ("master_sig",
master_sig));
eh = TALER_EXCHANGE_curl_easy_get_ (rh->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&rh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&rh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (rh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_set_global_fee.c b/src/lib/exchange_api_management_set_global_fee.c
index a79dddc9d..b600c8cbe 100644
--- a/src/lib/exchange_api_management_set_global_fee.c
+++ b/src/lib/exchange_api_management_set_global_fee.c
@@ -179,16 +179,17 @@ TALER_EXCHANGE_management_set_global_fees (
GNUNET_JSON_pack_uint64 ("purse_account_limit",
purse_account_limit));
eh = TALER_EXCHANGE_curl_easy_get_ (sgfh->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&sgfh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&sgfh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (sgfh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_set_wire_fee.c b/src/lib/exchange_api_management_set_wire_fee.c
index 84c6fe909..5951b6e20 100644
--- a/src/lib/exchange_api_management_set_wire_fee.c
+++ b/src/lib/exchange_api_management_set_wire_fee.c
@@ -168,16 +168,17 @@ TALER_EXCHANGE_management_set_wire_fees (
TALER_JSON_pack_amount ("wire_fee",
&fees->wire));
eh = TALER_EXCHANGE_curl_easy_get_ (swfh->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&swfh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&swfh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (swfh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_wire_disable.c b/src/lib/exchange_api_management_wire_disable.c
index 3bae8e3ab..5d97eef75 100644
--- a/src/lib/exchange_api_management_wire_disable.c
+++ b/src/lib/exchange_api_management_wire_disable.c
@@ -163,16 +163,17 @@ TALER_EXCHANGE_management_disable_wire (
GNUNET_JSON_pack_timestamp ("validity_end",
validity_end));
eh = TALER_EXCHANGE_curl_easy_get_ (wh->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&wh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&wh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (wh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_management_wire_enable.c b/src/lib/exchange_api_management_wire_enable.c
index 6e3dbad19..55480474e 100644
--- a/src/lib/exchange_api_management_wire_enable.c
+++ b/src/lib/exchange_api_management_wire_enable.c
@@ -174,16 +174,17 @@ TALER_EXCHANGE_management_enable_wire (
GNUNET_JSON_pack_timestamp ("validity_start",
validity_start));
eh = TALER_EXCHANGE_curl_easy_get_ (wh->url);
- GNUNET_assert (NULL != eh);
- if (GNUNET_OK !=
- TALER_curl_easy_post (&wh->post_ctx,
- eh,
- body))
+ if ( (NULL == eh) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&wh->post_ctx,
+ eh,
+ body)) )
{
GNUNET_break (0);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (body);
GNUNET_free (wh->url);
- GNUNET_free (eh);
return NULL;
}
json_decref (body);
diff --git a/src/lib/exchange_api_purse_create_with_merge.c b/src/lib/exchange_api_purse_create_with_merge.c
index 4ca633360..2b4f1cd27 100644
--- a/src/lib/exchange_api_purse_create_with_merge.c
+++ b/src/lib/exchange_api_purse_create_with_merge.c
@@ -357,7 +357,6 @@ TALER_EXCHANGE_purse_create_with_merge (
GNUNET_free (pcm);
return NULL;
}
- pcm->h_contract_terms = pcm->h_contract_terms;
pcm->merge_timestamp = merge_timestamp;
GNUNET_CRYPTO_eddsa_key_get_public (&purse_priv->eddsa_priv,
&pcm->purse_pub.eddsa_pub);
@@ -401,8 +400,9 @@ TALER_EXCHANGE_purse_create_with_merge (
}
else
{
- TALER_amount_set_zero (pcm->purse_value_after_fees.currency,
- &purse_fee);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (pcm->purse_value_after_fees.currency,
+ &purse_fee));
flags = TALER_WAMF_MODE_CREATE_FROM_PURSE_QUOTA;
}
diff --git a/src/testing/testing_api_cmd_purse_merge.c b/src/testing/testing_api_cmd_purse_merge.c
index 68cd5ea57..f2290523f 100644
--- a/src/testing/testing_api_cmd_purse_merge.c
+++ b/src/testing/testing_api_cmd_purse_merge.c
@@ -133,8 +133,10 @@ merge_cb (void *cls,
{
ds->reserve_history.type = TALER_EXCHANGE_RTT_MERGE;
ds->reserve_history.amount = ds->value_after_fees;
- TALER_amount_set_zero (ds->value_after_fees.currency,
- &ds->reserve_history.details.merge_details.purse_fee);
+ GNUNET_assert (GNUNET_OK ==
+ TALER_amount_set_zero (
+ ds->value_after_fees.currency,
+ &ds->reserve_history.details.merge_details.purse_fee));
ds->reserve_history.details.merge_details.h_contract_terms
= ds->h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub
diff --git a/src/util/taler-exchange-secmod-cs.c b/src/util/taler-exchange-secmod-cs.c
index 33167c8ea..ffd12dee8 100644
--- a/src/util/taler-exchange-secmod-cs.c
+++ b/src/util/taler-exchange-secmod-cs.c
@@ -1215,7 +1215,6 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"open",
filename);
- GNUNET_break (0 == close (fd));
return GNUNET_OK;
}
if (0 != fstat (fd,
@@ -1224,6 +1223,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat",
filename);
+ GNUNET_break (0 == close (fd));
return GNUNET_OK;
}
if (! S_ISREG (sbuf.st_mode))
diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c
index 21aedbc2a..9f6f6d746 100644
--- a/src/util/taler-exchange-secmod-eddsa.c
+++ b/src/util/taler-exchange-secmod-eddsa.c
@@ -918,6 +918,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat",
filename);
+ GNUNET_break (0 == close (fd));
return GNUNET_OK;
}
if (! S_ISREG (sbuf.st_mode))
@@ -925,6 +926,7 @@ import_key (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"File `%s' is not a regular file, which is not allowed for private keys!\n",
filename);
+ GNUNET_break (0 == close (fd));
return GNUNET_OK;
}
if (0 != (sbuf.st_mode & (S_IWUSR | S_IRWXG | S_IRWXO)))
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 670804e7b..713c3498d 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -628,8 +628,8 @@ sem_up (struct Semaphore *sem)
static void
sem_done (struct Semaphore *sem)
{
- pthread_cond_destroy (&sem->cv);
- pthread_mutex_destroy (&sem->mutex);
+ GNUNET_break (0 == pthread_cond_destroy (&sem->cv));
+ GNUNET_break (0 == pthread_mutex_destroy (&sem->mutex));
}
@@ -1625,6 +1625,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat",
filename);
+ GNUNET_break (0 == close (fd));
return GNUNET_OK;
}
if (! S_ISREG (sbuf.st_mode))