mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
xen_xm: Resolve Coverity USE_AFTER_FREE
If virDomainDiskDefFree(disk) is called in 'skipdisk:', then it's possible to either return to skipdisk without reallocating a new disk (via the if condition just prior) or to end the loop having deleted the disk. Since virDomainDiskDefFree() does not pass by reference, disk isn't changed in this context, thus the possible issue.
This commit is contained in:
parent
0454f23c31
commit
cfbbeb36cf
@ -201,6 +201,7 @@ xenParseXMDisk(virConfPtr conf, virDomainDefPtr def, int xendConfigVersion)
|
||||
skipdisk:
|
||||
list = list->next;
|
||||
virDomainDiskDefFree(disk);
|
||||
disk = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user