[Spice-devel] [PATCH spice-gtk 1/5] usb-acl-helper: Remove extra check for NULL

Victor Toso lists at victortoso.com
Thu Mar 17 13:23:49 UTC 2016


Tested. Looks fine!
Acked-by: Victor Toso <victortoso at redhat.com>

On Thu, Mar 17, 2016 at 11:19:32AM +0100, Pavel Grunt wrote:
> g_cancellable_cancel() and g_clear_object() can handle it
> ---
>  src/spice-client-glib-usb-acl-helper.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/spice-client-glib-usb-acl-helper.c b/src/spice-client-glib-usb-acl-helper.c
> index 3c5de05..20d1558 100644
> --- a/src/spice-client-glib-usb-acl-helper.c
> +++ b/src/spice-client-glib-usb-acl-helper.c
> @@ -150,8 +150,7 @@ out:
>  
>  static void cleanup(void)
>  {
> -    if (polkit_cancellable)
> -        g_cancellable_cancel(polkit_cancellable);
> +    g_cancellable_cancel(polkit_cancellable);
>  
>      if (state == STATE_WAITING_FOR_STDIN_EOF)
>          set_facl(path, getuid(), 0);
> @@ -361,8 +360,7 @@ int main(void)
>  
>      g_main_loop_run(loop);
>  
> -    if (polkit_cancellable)
> -        g_clear_object(&polkit_cancellable);
> +    g_clear_object(&polkit_cancellable);
>      g_object_unref(stdin_stream);
>      g_object_unref(authority);
>      g_object_unref(subject);
> -- 
> 2.7.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list