diff --git a/src/util/virpci.c b/src/util/virpci.c index 915a4903ca..f307580a53 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2150,8 +2150,8 @@ virPCIDeviceIsBehindSwitchLackingACS(virPCIDevice *dev) return 1; } - tmp = parent; - ret = virPCIDeviceGetParent(parent, &parent); + tmp = g_steal_pointer(&parent); + ret = virPCIDeviceGetParent(tmp, &parent); if (ret < 0) return -1; } while (parent);