]> git.proxmox.com Git - qemu.git/commit
scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL
authorJim Meyering <meyering@redhat.com>
Thu, 4 Oct 2012 11:09:44 +0000 (13:09 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 5 Oct 2012 12:58:36 +0000 (07:58 -0500)
commita5cf8262e4eb9c4646434e2c6211ef8608db3233
treef77b60c58c43c2c8c079b3166de4b0141a3266dd
parenta14c74928ba1fdaada515717f4d3c3fa3275d6f7
scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL

Use g_strdup rather than strdup, because the sole caller
(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
it.  Besides, in that caller, the allocated buffer is already freed with
g_free, so it's better to allocate with a matching g_strdup.

In one case, (scsi-bus.c) it was trivial, so I replaced an snprintf+
g_strdup combination with an equivalent g_strdup_printf use.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/qdev.c
hw/isa-bus.c
hw/pci.c
hw/qdev.c
hw/scsi-bus.c
hw/sysbus.c