From: Simon McVittie Date: Sat, 29 Oct 2016 17:36:19 +0000 (+0100) Subject: keyfile_set_from_vardict: free the string array X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~44^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=47397097423578a43ce827e663e9e008887eaf54;p=ostree.git 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 --- 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