mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
interface: report correct interface count when not returning list
The spec for virConnectListAllInterfaces says that if the pointer that is supposed to hold the list of interfaces is NULL, the function should just return the count of interfaces that matched the filter, but the code never increments the count if the list pointer is NULL.
This commit is contained in:
parent
ead2df32ba
commit
6fda6699e5
@ -632,8 +632,9 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
|
|||||||
if (!(iface_obj = virGetInterface(conn, ncf_if_name(iface),
|
if (!(iface_obj = virGetInterface(conn, ncf_if_name(iface),
|
||||||
ncf_if_mac_string(iface))))
|
ncf_if_mac_string(iface))))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
tmp_iface_objs[niface_objs++] = iface_obj;
|
tmp_iface_objs[niface_objs] = iface_obj;
|
||||||
}
|
}
|
||||||
|
niface_objs++;
|
||||||
|
|
||||||
ncf_if_free(iface);
|
ncf_if_free(iface);
|
||||||
iface = NULL;
|
iface = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user