From 0a3090b1d2e3f62578b2f982b11fc5f0185b1de2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 21 Nov 2022 09:50:51 +0100 Subject: qemu-config: Use ERRP_GUARD() where obviously appropriate Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-8-armbru@redhat.com> --- util/qemu-config.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/util/qemu-config.c b/util/qemu-config.c index e983607..8c907fa 100644 --- a/util/qemu-config.c +++ b/util/qemu-config.c @@ -318,9 +318,9 @@ void qemu_add_opts(QemuOptsList *list) static int qemu_config_foreach(FILE *fp, QEMUConfigCB *cb, void *opaque, const char *fname, Error **errp) { + ERRP_GUARD(); char line[1024], prev_group[64], group[64], arg[64], value[1024]; Location loc; - Error *local_err = NULL; QDict *qdict = NULL; int res = -EINVAL, lno = 0; int count = 0; @@ -348,10 +348,9 @@ static int qemu_config_foreach(FILE *fp, QEMUConfigCB *cb, void *opaque, } if (qdict != prev) { if (prev) { - cb(prev_group, prev, opaque, &local_err); + cb(prev_group, prev, opaque, errp); qobject_unref(prev); - if (local_err) { - error_propagate(errp, local_err); + if (*errp) { goto out; } } -- cgit v1.1