diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-09-30 13:59:46 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2016-10-07 19:22:11 +0200 |
commit | 5d0cbbcfeb59e1e3f5ee7d26b8a215382f6d9abd (patch) | |
tree | e3575cbda4b4121a002095d8a44b029dca5c269d /qapi | |
parent | bce3035a44c40bd3ec29d3162025fd350f2d8dbf (diff) |
qapi: add assert about root value
qiv->root should not be null, make that clearer with some assert.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20160930095948.3154-2-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/qmp-input-visitor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c index fc91e74894..c7deca95b3 100644 --- a/qapi/qmp-input-visitor.c +++ b/qapi/qmp-input-visitor.c @@ -64,6 +64,7 @@ static QObject *qmp_input_get_object(QmpInputVisitor *qiv, if (QSLIST_EMPTY(&qiv->stack)) { /* Starting at root, name is ignored. */ + assert(qiv->root); return qiv->root; } @@ -395,6 +396,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict) { QmpInputVisitor *v; + assert(obj); v = g_malloc0(sizeof(*v)); v->visitor.type = VISITOR_INPUT; |