337a1ad SBUS: defer deallocation of sbus_watch_ctx

1 file Authored by atikhonov 4 years ago, Committed by pbrezina 4 years ago,
    SBUS: defer deallocation of sbus_watch_ctx
    
    The following flow was causing use-after-free error:
      tevent_common_invoke_fd_handler(RW) -> sbus_watch_handler(RW) ->
      dbus_watch_handle(R) -> ...libdbus detects connection is closed... ->
      sbus_watch_remove() -> talloc_free(watch_fd) ->
      ... get back to libdbus and back to sbus_watch_handler() ->
      "if (watch_fd->dbus_watch.write != NULL) dbus_watch_handle(W)"
      => use-after-free
    
    To resolve an issue schedule deallocation of watch as immediate event.
    
    Resolves: https://pagure.io/SSSD/sssd/issue/2660
    
    Reviewed-by: Pavel Březina <pbrezina@redhat.com>