mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: fix use-after-free when parsing NBD disk
disk->src is still used for disks->hosts->name, do not free it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
5b17c7a954
commit
0a562de1ff
@ -8832,12 +8832,11 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
|
||||
if (VIR_ALLOC(disk->hosts) < 0)
|
||||
goto no_memory;
|
||||
disk->nhosts = 1;
|
||||
disk->hosts->name = host;
|
||||
disk->hosts->name = disk->src;
|
||||
disk->src = NULL;
|
||||
disk->hosts->port = strdup(port);
|
||||
if (!disk->hosts->port)
|
||||
goto no_memory;
|
||||
VIR_FREE(disk->src);
|
||||
disk->src = NULL;
|
||||
break;
|
||||
case VIR_DOMAIN_DISK_PROTOCOL_RBD:
|
||||
/* old-style CEPH_ARGS env variable is parsed later */
|
||||
|
Loading…
x
Reference in New Issue
Block a user