mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
failover: Remove memory leak
Two things, at this point: * n->primary_device_id has to be set, otherwise virtio_net_find_primary don't work. So we have a leak here. * it has to be exactly the same that prim_dev->id because what qdev_find_recursive() does is just compare this two values. So remove the unneeded assignment and leaky bits. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-14-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
9673a88e97
commit
7b3dc2f8c0
1 changed files with 1 additions and 3 deletions
|
@ -854,9 +854,7 @@ static DeviceState *virtio_connect_failover_devices(VirtIONet *n, Error **errp)
|
||||||
Error *err = NULL;
|
Error *err = NULL;
|
||||||
|
|
||||||
prim_dev = virtio_net_find_primary(n, &err);
|
prim_dev = virtio_net_find_primary(n, &err);
|
||||||
if (prim_dev) {
|
if (!prim_dev) {
|
||||||
n->primary_device_id = g_strdup(prim_dev->id);
|
|
||||||
} else {
|
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue