After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754520 - mutter-launch: check if error is set before dereferencing
mutter-launch: check if error is set before dereferencing
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-03 13:15 UTC by Marek Chalupa
Modified: 2015-09-07 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check if error is set before dereferencing (1.31 KB, patch)
2015-09-03 13:15 UTC, Marek Chalupa
none Details | Review
Check if error is set before dereferencing (1.19 KB, patch)
2015-09-03 13:54 UTC, Marek Chalupa
reviewed Details | Review

Description Marek Chalupa 2015-09-03 13:15:36 UTC
Created attachment 310588 [details] [review]
Check if error is set before dereferencing

If login1_session_call_take_control_sync() returns FALSE due to some g_return_val_if_fail it does not set the error, which leads to crash in subsequent g_warning( ... , error->message)
Comment 1 Marek Chalupa 2015-09-03 13:54:40 UTC
Created attachment 310593 [details] [review]
Check if error is set before dereferencing

do not call g_error_free(NULL)
Comment 2 Marek Chalupa 2015-09-03 13:55:38 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1254296
Comment 3 Florian Müllner 2015-09-03 14:34:22 UTC
Review of attachment 310593 [details] [review]:

::: src/backends/native/meta-launcher.c
@@ +376,3 @@
   if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, &error))
     {
+      g_warning ("Could not take control");

I would prefer to not split the error on two lines, i.e.

if (error)
  {
    g_warning ("Could not take control: %s, error->message);
    g_error_free (error);
  }
else
  {
    g_warning ("Could not take control");
  }
Comment 4 Ray Strode [halfline] 2015-09-07 12:48:42 UTC
(this got fixed by bug 753434 )