From: Michal Privoznik Date: Fri, 14 Jan 2022 09:35:17 +0000 (+0100) Subject: virconf: Report an error in when virConfSetValue() fails X-Git-Tag: v8.1.0-rc1~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfda149e151a7a130357c9958f8e6f4e61ff7f58;p=thirdparty%2Flibvirt.git virconf: Report an error in when virConfSetValue() fails 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 --- 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; }