aboutsummaryrefslogtreecommitdiff
path: root/src/util/conversion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/conversion.c')
-rw-r--r--src/util/conversion.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/util/conversion.c b/src/util/conversion.c
index 501ca0145..fdeffba40 100644
--- a/src/util/conversion.c
+++ b/src/util/conversion.c
@@ -251,7 +251,7 @@ child_done_cb (void *cls,
long unsigned int exit_code)
{
struct TALER_JSON_ExternalConversion *ec = cls;
- json_t *j;
+ json_t *j = NULL;
json_error_t err;
ec->cwh = NULL;
@@ -269,16 +269,19 @@ child_done_cb (void *cls,
}
GNUNET_OS_process_destroy (ec->helper);
ec->helper = NULL;
- j = json_loadb (ec->read_buf,
- ec->read_pos,
- JSON_REJECT_DUPLICATES,
- &err);
- if (NULL == j)
+ if (0 != ec->read_pos)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to parse JSON from helper at %d: %s\n",
- err.position,
- err.text);
+ j = json_loadb (ec->read_buf,
+ ec->read_pos,
+ JSON_REJECT_DUPLICATES,
+ &err);
+ if (NULL == j)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to parse JSON from helper at %d: %s\n",
+ err.position,
+ err.text);
+ }
}
ec->cb (ec->cb_cls,
type,