[Libvirt-cim] [PATCH 3 of 3] Adding ElementSettingData association

Dan Smith danms at us.ibm.com
Wed Nov 14 23:46:56 UTC 2007


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 at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20071114/5cf809a2/attachment.sig>


More information about the Libvirt-cim mailing list