The function produces an error which is ignored in this code path.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
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;