aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_mhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json/json_mhd.c')
-rw-r--r--src/json/json_mhd.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/json/json_mhd.c b/src/json/json_mhd.c
index 3a711b4f4..0b0fa0538 100644
--- a/src/json/json_mhd.c
+++ b/src/json/json_mhd.c
@@ -328,15 +328,25 @@ GNUNET_JSON_post_parser (size_t buffer_max,
328 } 328 }
329 } 329 }
330 330
331 *json = json_loadb (r->data, r->fill, 0, NULL);
332 if (NULL == *json)
333 { 331 {
334 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 332 json_error_t err;
335 "Failed to parse JSON request body\n"); 333
336 buffer_deinit (r); 334 *json = json_loadb (r->data,
337 GNUNET_free (r); 335 r->fill,
338 *con_cls = NULL; 336 0,
339 return GNUNET_JSON_PR_JSON_INVALID; 337 &err);
338 if (NULL == *json)
339 {
340 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
341 "Failed to parse JSON request body of %u byte at offset %d: %s\n",
342 (unsigned int) r->fill,
343 err.position,
344 err.text);
345 buffer_deinit (r);
346 GNUNET_free (r);
347 *con_cls = NULL;
348 return GNUNET_JSON_PR_JSON_INVALID;
349 }
340 } 350 }
341 buffer_deinit (r); 351 buffer_deinit (r);
342 GNUNET_free (r); 352 GNUNET_free (r);