diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2015-04-09 16:57:30 -0300 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-06-19 10:29:14 +0200 |
commit | 6bc5cf92c0ab0085ba9a6e0cebcf5a544f416ca7 (patch) | |
tree | 902503d3cb2c1d40b26a70bd6680aa6a6959cc6f | |
parent | 1590d266d96b3f9b42443d6388dfc38f527ac2d8 (diff) |
qdev: Free property names after registering gpio aliases
Now that object_property_add_alias() strdup()s target_name, we can free
the property names in qdev_pass_gpios().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r-- | hw/core/qdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b0f0f84564..d10fa5fbf6 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -563,6 +563,7 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container, object_property_add_alias(OBJECT(container), propname, OBJECT(dev), propname, &error_abort); + g_free(propname); } for (i = 0; i < ngl->num_out; i++) { const char *nm = ngl->name ? ngl->name : "unnamed-gpio-out"; @@ -571,6 +572,7 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container, object_property_add_alias(OBJECT(container), propname, OBJECT(dev), propname, &error_abort); + g_free(propname); } QLIST_REMOVE(ngl, node); QLIST_INSERT_HEAD(&container->gpios, ngl, node); |