linux: fix memleak when reading critical action

g_variant_get for string types must be freed as documented at
https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-strings
Since we just want to compare it, use a pointer as documented at
https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-pointers

https://bugs.freedesktop.org/show_bug.cgi?id=82659
This commit is contained in:
Peter Wu 2014-11-06 18:29:07 +01:00 committed by Richard Hughes
parent b3e5143f5a
commit 71cbf8dfb9

View file

@ -346,7 +346,7 @@ check_action_result (GVariant *result)
if (result) {
const char *s;
g_variant_get (result, "(s)", &s);
g_variant_get (result, "(&s)", &s);
if (g_strcmp0 (s, "yes") == 0)
return TRUE;
}