Merge tag 'upstream/2.34.0' into tizen
[platform/upstream/at-spi2-core.git] / registryd / deviceeventcontroller.c
index acd089b..2a0721d 100644 (file)
@@ -927,6 +927,7 @@ send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, int timeout,
       {
         const char *dest = dbus_message_get_destination (message);
         GSList *l;
+        dbus_bool_t result;
         gchar *bus_name_dup;
         dbus_message_ref (message);
         dbus_pending_call_set_notify (pending, reset_hung_process, message,
@@ -936,9 +937,9 @@ send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, int timeout,
                                                 "Ping");
         if (!message)
           return NULL;
-        dbus_connection_send_with_reply (bus, message, &pending, -1);
+        result = dbus_connection_send_with_reply (bus, message, &pending, -1);
         dbus_message_unref (message);
-        if (!pending)
+        if (!result || !pending)
           return NULL;
         bus_name_dup = g_strdup (dest);
         dbus_pending_call_set_notify (pending, reset_hung_process_from_ping,
@@ -1365,6 +1366,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);
@@ -1575,6 +1577,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);