summaryrefslogtreecommitdiff
path: root/atspi/atspi-device-legacy.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2021-02-23 10:12:15 -0600
committerMike Gorse <mgorse@suse.com>2021-02-23 10:12:15 -0600
commit7dfb0b7fc2d1710ef7fad54f910fa4c6a5e3af17 (patch)
tree374ec0523546f4a677469eb45f737c99fc3400f1 /atspi/atspi-device-legacy.c
parentc1f698deeb1d283ee1df68715a0465785d218a3a (diff)
downloadat-spi2-core-7dfb0b7fc2d1710ef7fad54f910fa4c6a5e3af17.tar.gz
AtspiDeviceListenerCB: remove const from event prototype
The parameter is marked with (transfer full), and the code expects the caller to free the event, so adjust the prototype to clarify the expected behavior. Also fix a related memory leak in atspi-device-legacy.c. Fixes #31
Diffstat (limited to 'atspi/atspi-device-legacy.c')
-rw-r--r--atspi/atspi-device-legacy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/atspi/atspi-device-legacy.c b/atspi/atspi-device-legacy.c
index 6950bc37..6c19b790 100644
--- a/atspi/atspi-device-legacy.c
+++ b/atspi/atspi-device-legacy.c
@@ -86,7 +86,7 @@ set_virtual_modifier (AtspiDeviceLegacy *legacy_device, gint keycode, gboolean e
gboolean
-key_cb (const AtspiDeviceEvent *event, void *user_data)
+key_cb (AtspiDeviceEvent *event, void *user_data)
{
AtspiDeviceLegacy *legacy_device = ATSPI_DEVICE_LEGACY (user_data);
AtspiDeviceLegacyPrivate *priv = atspi_device_legacy_get_instance_private (legacy_device);
@@ -100,6 +100,7 @@ key_cb (const AtspiDeviceEvent *event, void *user_data)
event->modifiers | priv->virtual_mods_enabled,
event->event_string);
+ g_boxed_free (ATSPI_TYPE_DEVICE_EVENT, event);
return ret;
}