summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-01-10 14:34:37 +0100
committerChristian Grothoff <christian@grothoff.org>2019-01-10 14:34:37 +0100
commitb86be70c46c18b7dea1f803ff107846822e958d6 (patch)
tree3f5c2ef14034cc4860fa0e9d2a7f7f6ed878d484 /src
parent828cd528f5861226958a26cbe85e05f16fe2cb31 (diff)
downloadmerchant-b86be70c46c18b7dea1f803ff107846822e958d6.tar.gz
merchant-b86be70c46c18b7dea1f803ff107846822e958d6.tar.bz2
merchant-b86be70c46c18b7dea1f803ff107846822e958d6.zip
fix bogus free of uninitialized variable in test logic on error path
Diffstat (limited to 'src')
-rw-r--r--src/lib/testing_api_cmd_pay.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/testing_api_cmd_pay.c b/src/lib/testing_api_cmd_pay.c
index 97fac91a..6121171e 100644
--- a/src/lib/testing_api_cmd_pay.c
+++ b/src/lib/testing_api_cmd_pay.c
@@ -737,7 +737,6 @@ _pay_run (const char *merchant_url,
void (*api_cb) (),
void *cls)
{
- json_t *ct;
const struct TALER_TESTING_Command *proposal_cmd;
const json_t *contract_terms;
const char *order_id;
@@ -757,8 +756,8 @@ _pay_run (const char *merchant_url,
struct TALER_MerchantSignatureP *merchant_sig;
struct TALER_MERCHANT_Pay *ret;
- proposal_cmd = TALER_TESTING_interpreter_lookup_command
- (is, proposal_reference);
+ proposal_cmd = TALER_TESTING_interpreter_lookup_command (is,
+ proposal_reference);
if (NULL == proposal_cmd)
{
@@ -766,8 +765,10 @@ _pay_run (const char *merchant_url,
return NULL;
}
- if (GNUNET_OK != TALER_TESTING_get_trait_contract_terms
- (proposal_cmd, 0, &contract_terms))
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_contract_terms (proposal_cmd,
+ 0,
+ &contract_terms))
{
GNUNET_break (0);
return NULL;
@@ -794,6 +795,7 @@ _pay_run (const char *merchant_url,
&max_fee),
GNUNET_JSON_spec_end()
};
+
if (GNUNET_OK !=
GNUNET_JSON_parse (contract_terms,
spec,
@@ -801,14 +803,12 @@ _pay_run (const char *merchant_url,
&error_line))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Parser failed on %s:%u\n",
+ "Parser failed on %s:%u for input `%s'\n",
error_name,
- error_line);
- fprintf (stderr, "%s\n",
- json_dumps (contract_terms,
- JSON_INDENT (1)));
+ error_line,
+ json_dumps (contract_terms,
+ JSON_INDENT (1)));
GNUNET_break_op (0);
- json_decref (ct);
return NULL;
}