[Libvirt-cim] [PATCH 1 of 2] SDC: returned instances are not of type specific subclass

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Dec 11 18:03:55 UTC 2007


Heidi Eckhart wrote:
>        
> +        if (base)
> +                inst = get_typed_instance(broker,
> +                                          CLASSNAME(ref),
> +                                          base,
> +                                          NAMESPACE(ref));
>          
>          CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars);
>          CMSetProperty(inst, "PropertyPolicy", &policy, CMPI_uint16);
>   
Should there be an else statement here?  If the if statement fails, then 
an instance isn't created.  CMSetProperty() would be trying to get the 
value of a NULL inst, which would most likely fail.

-- 
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com





More information about the Libvirt-cim mailing list