From: Ján Tomko Date: Fri, 20 Nov 2020 13:10:58 +0000 (+0100) Subject: udevConnectListAllInterfaces: delete pointless cleanup code X-Git-Tag: v7.0.0-rc1~382 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=366891533f1809387aa705226390491c5ee4875f;p=thirdparty%2Flibvirt.git udevConnectListAllInterfaces: delete pointless cleanup code We only jump to cleanup before allocating any lists. Drop the dead code. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index 31246dde74..173c4fc3f0 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -300,7 +300,6 @@ udevConnectListAllInterfaces(virConnectPtr conn, struct udev_list_entry *dev_entry; virInterfacePtr *ifaces_list = NULL; virInterfacePtr iface_obj; - int tmp_count; int count = 0; int status = 0; int ret = -1; @@ -405,14 +404,6 @@ udevConnectListAllInterfaces(virConnectPtr conn, if (enumerate) udev_enumerate_unref(enumerate); udev_unref(udev); - - if (ifaces) { - for (tmp_count = 0; tmp_count < count; tmp_count++) - virObjectUnref(ifaces_list[tmp_count]); - } - - VIR_FREE(ifaces_list); - return ret; }