aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_admin.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-08 09:47:50 +0200
committerChristian Grothoff <christian@grothoff.org>2015-07-08 09:47:50 +0200
commit663ea48047a159aaa482408a59a869b6db8a82a8 (patch)
tree609a8e6d61a90e16d01a9ff96d133e9ef535b922 /src/mint/taler-mint-httpd_admin.c
parentea5c1233f13ad3128207b6b84401d8638dbc43e5 (diff)
nice error reporting
Diffstat (limited to 'src/mint/taler-mint-httpd_admin.c')
-rw-r--r--src/mint/taler-mint-httpd_admin.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mint/taler-mint-httpd_admin.c b/src/mint/taler-mint-httpd_admin.c
index ce63917ef..6928dac8b 100644
--- a/src/mint/taler-mint-httpd_admin.c
+++ b/src/mint/taler-mint-httpd_admin.c
@@ -136,15 +136,26 @@ TMH_ADMIN_handler_admin_add_incoming (struct TMH_RequestHandler *rh,
res = TMH_PARSE_json_data (connection,
root,
spec);
- json_decref (root);
if (GNUNET_OK != res)
+ {
+ json_decref (root);
return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
+ }
+ if (GNUNET_YES !=
+ TALER_json_validate_wireformat (TMH_expected_wire_format,
+ wire))
+ {
+ TMH_PARSE_release_data (spec);
+ return TMH_RESPONSE_reply_arg_unknown (connection,
+ "wire");
+ }
res = TMH_DB_execute_admin_add_incoming (connection,
&reserve_pub,
&amount,
at,
wire);
TMH_PARSE_release_data (spec);
+ json_decref (root);
return res;
}