mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
cc98467327
commit
d21357df9a
3 changed files with 13 additions and 0 deletions
|
@ -98,6 +98,7 @@ struct PropertyInfo {
|
|||
enum PropertyType type;
|
||||
int (*parse)(DeviceState *dev, Property *prop, const char *str);
|
||||
int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
|
||||
void (*free)(DeviceState *dev, Property *prop);
|
||||
};
|
||||
|
||||
typedef struct GlobalProperty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue