Argument is null when visiting an unboxed struct. I can't see such a
visit in the current code. Fix it anyway.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v);
const QemuOpt *opt;
- *obj = g_malloc0(size > 0 ? size : 1);
+ if (obj) {
+ *obj = g_malloc0(size > 0 ? size : 1);
+ }
if (ov->depth++ > 0) {
return;
}