Compilers aren't able to see whether @result is set or not and thus
don't warn of a potential use of uninitialized value. Always set @result
to prevent uninitialized use.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* @result: The returned value
*
* Convenience function to return value of a yes / no attribute.
+ * In case when the property is missing @result is initialized to
+ * VIR_TRISTATE_BOOL_ABSENT.
*
* Returns 1 in case of success in which case @result is set,
* or 0 if the attribute is not present,
{
flags |= VIR_XML_PROP_NONZERO;
+ *result = VIR_TRISTATE_BOOL_ABSENT;
+
return virXMLPropEnumInternal(node, name, virTristateBoolTypeFromString,
flags, result);
}