From 47397097423578a43ce827e663e9e008887eaf54 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 29 Oct 2016 18:36:19 +0100 Subject: [PATCH] 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 Closes: #556 Approved by: cgwalters --- src/libostree/ostree-repo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index c897f819..2e35faf8 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -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