qdev: Don't leak string property value on hot unplug
authorMarkus Armbruster <armbru@redhat.com>
Tue, 1 Jun 2010 18:32:31 +0000 (20:32 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Jun 2010 09:43:39 +0000 (11:43 +0200)
commit235a76b807a8263cb616c1a5d72043851fd24a59
tree7397e5342d9c2e51eddfe63b38a13b63d966fb2d
parent17084d540a9ef7dbb96ae51e2157773146889bbb
qdev: Don't leak string property value on hot unplug

parse_string() qemu_strdup()s the property value.  It is never freed.
It needs to be freed along with the device.  Otherwise, the value of
scsi-disk property "ver" gets leaked when hot-unplugging the disk, for
instance.

Call new PropertyInfo method free() from qdev_free().  Implement it
for qdev_prop_string.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/qdev-properties.c
hw/qdev.c
hw/qdev.h