aboutsummaryrefslogtreecommitdiff
path: root/qobject/json-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'qobject/json-parser.c')
-rw-r--r--qobject/json-parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 0e232ff101..b77931614b 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -54,13 +54,13 @@ static void GCC_FMT_ATTR(3, 4) parse_error(JSONParserContext *ctxt,
{
va_list ap;
char message[1024];
+
+ if (ctxt->err) {
+ return;
+ }
va_start(ap, msg);
vsnprintf(message, sizeof(message), msg, ap);
va_end(ap);
- if (ctxt->err) {
- error_free(ctxt->err);
- ctxt->err = NULL;
- }
error_setg(&ctxt->err, "JSON parse error, %s", message);
}