Message ID | 20160921201018.20957-2-marcandre.lureau@redhat.com |
---|---|
State | New |
Headers | show |
On 09/21/2016 03:10 PM, Marc-André Lureau wrote: > qiv->root should not be null, make that clearer with some assert. > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > qapi/qmp-input-visitor.c | 2 ++ > 1 file changed, 2 insertions(+) > Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c index 64dd392..be52aaf 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; } @@ -384,6 +385,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict) { QmpInputVisitor *v; + assert(obj); v = g_malloc0(sizeof(*v)); v->visitor.type = VISITOR_INPUT;
qiv->root should not be null, make that clearer with some assert. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- qapi/qmp-input-visitor.c | 2 ++ 1 file changed, 2 insertions(+)