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 670909 - g_dbus_connection_call leaks when it receives an error reply
g_dbus_connection_call leaks when it receives an error reply
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other All
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-02-27 19:24 UTC by Allison Karlitskaya (desrt)
Modified: 2012-02-27 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Allison Karlitskaya (desrt) 2012-02-27 19:24:26 UTC
g_dbus_connection_call_done() has this logic:

  reply = g_dbus_connection_send_message_with_reply_finish (connection,
                                                            result,
                                                            &error);

...

  if (reply != NULL)
    state->value = decode_method_reply (reply,
                                        state->method_name,
                                        state->reply_type,
                                        &state->fd_list,
                                        &error);

  simple = state->simple;
  if (error != NULL)
    {
      g_simple_async_result_take_error (state->simple, error);
      g_simple_async_result_complete (state->simple);
      call_state_free (state);
    }
  else
    {
      g_simple_async_result_set_op_res_gpointer (state->simple,
        state, (GDestroyNotify) call_state_free);
      g_simple_async_result_complete (state->simple);
      g_object_unref (reply);
    }

Which is clearly capable of having reply != NULL with error set.

In the (error != NULL) case reply isn't freed, and it leaks.
Comment 1 David Zeuthen (not reading bugmail) 2012-02-27 19:55:47 UTC
Fixed on master.. checked the test suite and it passes.. thanks for noticing.