The function produces an error which is ignored in this code path.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/domain_conf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d6eefed398..17ba810467 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7804,8 +7804,9 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt,
g_autofree char *relabel = NULL;
g_autoptr(virSecurityLabelDef) seclabel = NULL;
- model = virXMLPropStringLimit(ctxt->node, "model",
- VIR_SECURITY_MODEL_BUFLEN - 1);
+ if ((model = virXMLPropString(ctxt->node, "model")) &&
+ strlen(model) >= VIR_SECURITY_MODEL_BUFLEN - 1)
+ g_clear_pointer(&model, g_free);
if (!(seclabel = virSecurityLabelDefNew(model)))
return NULL;
--
2.31.1