pci: use qemu_malloc() in pcibus_get_dev_path()
use qemu_malloc() instead of direct use of malloc(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
e407bf13ba
commit
e10990c3f0
2
hw/pci.c
2
hw/pci.c
@ -2058,7 +2058,7 @@ static char *pcibus_get_dev_path(DeviceState *dev)
|
||||
path_len = domain_len + slot_len * slot_depth;
|
||||
|
||||
/* Allocate memory, fill in the terminating null byte. */
|
||||
path = malloc(path_len + 1 /* For '\0' */);
|
||||
path = qemu_malloc(path_len + 1 /* For '\0' */);
|
||||
path[path_len] = '\0';
|
||||
|
||||
/* First field is the domain. */
|
||||
|
Loading…
Reference in New Issue
Block a user