]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
qjson: Abort earlier on qobject_from_jsonf() misuse
authorMarkus Armbruster <armbru@redhat.com>
Tue, 28 Feb 2017 21:26:56 +0000 (22:26 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 7 Mar 2017 15:07:47 +0000 (16:07 +0100)
Ignoring errors first, then asserting success is suboptimal.  Pass
&error_abort instead, so we abort earlier, and hopefully get more
useful clues on what's wrong.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1488317230-26248-11-git-send-email-armbru@redhat.com>

qobject/qjson.c

index 339c9f7de2842a90cf2b9e2cbab70a479077e9c8..c98d6a71cc448f0641da489a4a7bbc8ffc62d768 100644 (file)
@@ -65,7 +65,7 @@ QObject *qobject_from_jsonf(const char *string, ...)
     va_list ap;
 
     va_start(ap, string);
-    obj = qobject_from_jsonv(string, &ap, NULL);
+    obj = qobject_from_jsonv(string, &ap, &error_abort);
     va_end(ap);
 
     assert(obj != NULL);