KR> +static CMPIInstance *make_ref(const CMPIObjectPath *ref,
KR> + const CMPIInstance *inst,
KR> + struct std_assoc_info *info,
KR> + struct std_assoc *assoc)
KR> +{
KR> + CMPIInstance *refinst = NULL;
KR> + char *base;
KR> + uint16_t prop_value = 1;
KR> +
KR> + base = class_base_name(assoc->assoc_class);
KR> + if (base == NULL)
KR> + goto out;
KR> +
KR> + refinst = get_typed_instance(_BROKER,
KR> + base,
KR> + NAMESPACE(ref));
KR> +
KR> + if (refinst != NULL) {
KR> + CMPIObjectPath *instop;
KR> +
KR> + instop = CMGetObjectPath(inst, NULL);
KR> +
KR> + set_reference(assoc, refinst, ref, instop);
KR> +
KR> + /* Set additional properties with values
KR> + * defined in the "Virtual System Profile."
KR> + */
KR> + CMSetProperty(refinst, "IsDefault",
KR> + (CMPIValue *)&prop_value, CMPI_uint16);
KR> +
KR> + CMSetProperty(refinst, "IsNext",
KR> + (CMPIValue *)&prop_value, CMPI_uint16);
KR> +
KR> + CMSetProperty(refinst, "IsMinimum",
KR> + (CMPIValue *)&prop_value, CMPI_uint16);
KR> +
KR> + CMSetProperty(refinst, "IsMaximum",
KR> + (CMPIValue *)&prop_value, CMPI_uint16);
KR> + }
KR> +
KR> +out:
KR> + return refinst;
KR> +}
You leak "base" here.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com