summaryrefslogtreecommitdiff
path: root/src/util/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/json.c')
-rw-r--r--src/util/json.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util/json.c b/src/util/json.c
index e4b0831a4..004f7734c 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -297,7 +297,19 @@ TALER_json_to_amount (json_t *json,
"fraction", &fraction,
"currency", &currency))
{
+ char *json_enc;
+
GNUNET_break_op (0);
+ if (NULL == (json_enc = json_dumps (json,
+ JSON_COMPACT | JSON_SORT_KEYS | JSON_ENCODE_ANY)))
+ {
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Malformed JSON amount: %s\n",
+ json_enc);
+ free (json_enc);
return GNUNET_SYSERR;
}
if ( (value < 0) ||
@@ -415,7 +427,7 @@ TALER_hash_json (json_t *json,
GNUNET_CRYPTO_hash (wire_enc,
len,
hc);
- GNUNET_free (wire_enc);
+ free (wire_enc);
return GNUNET_OK;
}