diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-03-13 23:59:13 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-03-14 00:00:11 +0100 |
commit | 9f6523b9c6b96554485cab6cad9ed75f9cfad0f6 (patch) | |
tree | 7237294b947706f0066b513f0d6702c5bec2d862 /registryd | |
parent | 68367675465c409af3fa701bd3f4b299cbfe183f (diff) | |
download | at-spi2-core-9f6523b9c6b96554485cab6cad9ed75f9cfad0f6.tar.gz |
impl_deregister_keystroke_listener: Fix kd structure leak on iteration error
Diffstat (limited to 'registryd')
-rw-r--r-- | registryd/deviceeventcontroller.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index 8a321adc..e277412f 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -1388,6 +1388,7 @@ impl_register_keystroke_listener (DBusConnection *bus, Accessibility_KeyDefinition *kd = (Accessibility_KeyDefinition *)g_malloc(sizeof(Accessibility_KeyDefinition)); if (!spi_dbus_message_iter_get_struct(&iter_array, DBUS_TYPE_INT32, &kd->keycode, DBUS_TYPE_INT32, &kd->keysym, DBUS_TYPE_STRING, &keystring, DBUS_TYPE_INVALID)) { + g_free(kd); break; } kd->keystring = g_strdup (keystring); @@ -1598,6 +1599,7 @@ impl_deregister_keystroke_listener (DBusConnection *bus, if (!spi_dbus_message_iter_get_struct(&iter_array, DBUS_TYPE_INT32, &kd->keycode, DBUS_TYPE_INT32, &kd->keysym, DBUS_TYPE_STRING, &keystring, DBUS_TYPE_INVALID)) { + g_free(kd); break; } kd->keystring = g_strdup (keystring); |