keyfile_set_from_vardict: free the string array
g_variant_get_strv is (transfer container): the caller is expected to free the array, but not the individual strings. Leak found with valgrind memcheck. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #556 Approved by: cgwalters
This commit is contained in:
parent
c8a6b037ef
commit
4739709742
|
|
@ -936,7 +936,7 @@ keyfile_set_from_vardict (GKeyFile *keyfile,
|
||||||
else if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING_ARRAY))
|
else if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING_ARRAY))
|
||||||
{
|
{
|
||||||
gsize len;
|
gsize len;
|
||||||
const char *const*strv_child = g_variant_get_strv (child, &len);
|
g_autofree const gchar **strv_child = g_variant_get_strv (child, &len);
|
||||||
g_key_file_set_string_list (keyfile, section, key, strv_child, len);
|
g_key_file_set_string_list (keyfile, section, key, strv_child, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue