From f0f7ad14e9529b7a26602736761c42279d94ad34 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Sat, 4 Jul 2020 17:55:59 -0400 Subject: [PATCH] conf: consistently check for error when calling virSysinfoFormat() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every other caller of this function checks for an error return and ends their formatting early if there is an error. This function happily continues on its way. Signed-off-by: Laine Stump Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 37d4ccf955..3a110b330f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29581,8 +29581,10 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def, if (def->resource) virDomainResourceDefFormat(buf, def->resource); - for (i = 0; i < def->nsysinfo; i++) - virSysinfoFormat(buf, def->sysinfo[i]); + for (i = 0; i < def->nsysinfo; i++) { + if (virSysinfoFormat(buf, def->sysinfo[i]) < 0) + goto error; + } if (def->os.bootloader) { virBufferEscapeString(buf, "%s\n",