Skip to content

Commit

Permalink
object_add: consolidate error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
  • Loading branch information
Igor Mammedov authored and Luiz Capitulino committed Jan 28, 2014
1 parent 0169c51 commit 69252c0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qmp.c
Expand Up @@ -549,15 +549,17 @@ void object_add(const char *type, const char *id, const QDict *qdict,
for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
object_property_set(obj, v, e->key, &local_err);
if (local_err) {
error_propagate(errp, local_err);
object_unref(obj);
return;
goto out;
}
}
}

object_property_add_child(container_get(object_get_root(), "/objects"),
id, obj, errp);
id, obj, &local_err);
out:
if (local_err) {
error_propagate(errp, local_err);
}
object_unref(obj);
}

Expand Down

0 comments on commit 69252c0

Please sign in to comment.