[Libvirt-cim] [PATCH 1 of 2] (#3) Add get_vnc_sessions() to determine all of VNC ports available or in use
Dan Smith
danms at us.ibm.com
Wed Oct 29 19:33:39 UTC 2008
KR> + port_list.list = malloc(count * sizeof(struct vnc_port *));
KR> + if (!port_list.list) {
Our CodingStyle says that this should be:
if (port_list.list == NULL)
KR> + port_list.list[i] = malloc(sizeof(struct vnc_port));
KR> + if (!port_list.list[i]) {
Here too.
KR> + port_list.list[port_list.cur]->name = strdup(dominfo->name);
Your free() call later will handle this, but will other code expect
'name' to be non-NULL in the case of an allocation failure?
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
More information about the Libvirt-cim
mailing list