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 authored and Atomic Bot committed 2016-10-30 22:11:15 +00:00
1 parent c8a6b037ef
commit 4739709742
1 file changed
+1 -1
+1 -1
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