mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-06 09:08:05 +02:00
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:
parent
b3e5143f5a
commit
71cbf8dfb9
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue