[xdg-desktop-portal-gnome/wip/rishi/coverity-fixes-01: 1/4] appchooser: Don't use the AppDialogHandle after it has been freed




commit e997732a55a7fa397f3c2c52fd28465bba68c9b9
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Jul 2 16:02:35 2022 +0200

    appchooser: Don't use the AppDialogHandle after it has been freed

 src/appchooser.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/appchooser.c b/src/appchooser.c
index f2cc93e..74f0e08 100644
--- a/src/appchooser.c
+++ b/src/appchooser.c
@@ -124,16 +124,15 @@ handle_close (XdpImplRequest *object,
 {
   GVariantBuilder opt_builder;
 
+  if (handle->request->exported)
+    request_unexport (handle->request);
+
   g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
   xdp_impl_app_chooser_complete_choose_application (handle->impl,
                                                     handle->invocation,
                                                     2,
                                                     g_variant_builder_end (&opt_builder));
   app_dialog_handle_close (handle);
-
-  if (handle->request->exported)
-    request_unexport (handle->request);
-
   xdp_impl_request_complete_close (object, invocation);
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]