mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
Avoid deleting NULL veth device name
If veth device allocation has a fatal error, the veths array may contain NULL device names. Avoid calling the virNetDevVethDelete function on such names. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
10caf94ddc
commit
8766e9b5a5
@ -1290,7 +1290,7 @@ cleanup:
|
|||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nveths; i++) {
|
for (i = 0; i < nveths; i++) {
|
||||||
if (rc != 0)
|
if (rc != 0 && veths[i])
|
||||||
ignore_value(virNetDevVethDelete(veths[i]));
|
ignore_value(virNetDevVethDelete(veths[i]));
|
||||||
VIR_FREE(veths[i]);
|
VIR_FREE(veths[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user