[glib] gdbusauth: plug memory leak



commit 8693d60a280d10dfeda4ebd1aa6099b5d0456a1d
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date:   Tue Feb 21 02:20:52 2017 +0100

    gdbusauth: plug memory leak
    
    Happens when the waiting-for-auth state is re-entered:
    
    SERVER_STATE_WAITING_FOR_AUTH
      |
      v
    G_DBUS_AUTH_MECHANISM_STATE_REJECTED
      |
      v
    SERVER_STATE_WAITING_FOR_AUTH
    
    Causing the previous `mech` pointer to get overwritten.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778991

 gio/gdbusauth.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index a870e86..a4458b2 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -1132,6 +1132,7 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
                   gchar *initial_response;
                   gsize initial_response_len;
 
+                  g_clear_object (&mech);
                   mech = g_object_new (auth_mech_to_use_gtype,
                                        "stream", auth->priv->stream,
                                        "credentials", credentials,


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