diff --git a/cfg.mk b/cfg.mk index c093bf2483..bbe84b3174 100644 --- a/cfg.mk +++ b/cfg.mk @@ -165,6 +165,7 @@ useless_free_options = \ --name=virNodeDeviceObjFree \ --name=virObjectUnref \ --name=virObjectFreeCallback \ + --name=virPCIDeviceFree \ --name=virSecretDefFree \ --name=virStorageEncryptionFree \ --name=virStorageEncryptionSecretFree \ diff --git a/src/util/virpci.c b/src/util/virpci.c index 1346ec175e..89c1eea4cb 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1671,8 +1671,7 @@ virPCIDeviceListDel(virPCIDeviceListPtr list, virPCIDevicePtr dev) { virPCIDevicePtr ret = virPCIDeviceListSteal(list, dev); - if (ret) - virPCIDeviceFree(ret); + virPCIDeviceFree(ret); } int