diff options
author | Ismo Puustinen <ismo.puustinen@intel.com> | 2015-08-04 13:29:20 +0300 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-08-17 12:07:39 -0400 |
commit | ab1a4d58c5ae41fce2fb45046af6e3c42ff9b6a8 (patch) | |
tree | 6dd2c4b09d849879950b938f40b24f678b523518 | |
parent | a4731c0830daca3e895b71bd81a5547781df5017 (diff) | |
download | glib-ab1a4d58c5ae41fce2fb45046af6e3c42ff9b6a8.tar.gz |
gio: properly free memory, preventing leak and illegal access.
https://bugzilla.gnome.org/show_bug.cgi?id=753231
-rw-r--r-- | gio/gdbusauth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c index a29f97ea3..4036d778a 100644 --- a/gio/gdbusauth.c +++ b/gio/gdbusauth.c @@ -1064,6 +1064,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth, if (!g_data_output_stream_put_string (dos, s, cancellable, error)) { g_free (s); + g_free (line); goto out; } g_free (s); @@ -1077,7 +1078,6 @@ _g_dbus_auth_run_server (GDBusAuth *auth, GType auth_mech_to_use_gtype; tokens = g_strsplit (line, " ", 0); - g_free (line); switch (g_strv_length (tokens)) { @@ -1100,9 +1100,12 @@ _g_dbus_auth_run_server (GDBusAuth *auth, "Unexpected line '%s' while in WaitingForAuth state", line); g_strfreev (tokens); + g_free (line); goto out; } + g_free (line); + /* TODO: record that the client has attempted to use this mechanism */ //g_debug ("client is trying '%s'", mech_name); |