[Libvirt-cim] [PATCH 2 of 3] Add check in EAFP to ensure ref passed is an actual instance

Dan Smith danms at us.ibm.com
Fri Dec 21 14:47:40 UTC 2007


KR> -        type = device_type_from_poolid(poolid);
KR> +        type = device_type_from_str(class_base_name(CLASSNAME(ref)));

A couple things here.  First, I think that we should be passing in the
id, in case we need to do more specific checking in the future.  We
can check the classname of the ref separately.

Second, class_base_name() returns a strdup()'d string, so you leak
that 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/20071221/28d79570/attachment.sig>


More information about the Libvirt-cim mailing list