From dfda149e151a7a130357c9958f8e6f4e61ff7f58 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 14 Jan 2022 10:35:17 +0100 Subject: [PATCH] virconf: Report an error in when virConfSetValue() fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Callers of virConfSetValue() don't report any error, they just pass the error blindly. Therefore, report an error when virConfSetValue() is about to fail. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/util/virconf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virconf.c b/src/util/virconf.c index 07ecfc7b57..29b3622791 100644 --- a/src/util/virconf.c +++ b/src/util/virconf.c @@ -1329,6 +1329,9 @@ virConfSetValue(virConf *conf, virConfEntry *prev = NULL; if (value && value->type == VIR_CONF_STRING && value->str == NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("expecting a value for value of type %s"), + virConfTypeToString(VIR_CONF_STRING)); virConfFreeValue(value); return -1; } -- 2.47.2