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:
Simon McVittie 2016-10-29 18:36:19 +01:00 committed by Atomic Bot
parent c8a6b037ef
commit 4739709742
1 changed files with 1 additions and 1 deletions

View File

@ -936,7 +936,7 @@ keyfile_set_from_vardict (GKeyFile *keyfile,
else if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING_ARRAY))
{
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);
}
else