return r;
}
-static int add_locales_from_libdir (Set *locales) {
+static int add_locales_from_libdir(Set *locales) {
_cleanup_closedir_ DIR *dir = NULL;
int r;
}
int get_locales(char ***ret) {
- _cleanup_set_free_ Set *locales = NULL;
+ _cleanup_set_free_free_ Set *locales = NULL;
_cleanup_strv_free_ char **l = NULL;
int r;
if (!l)
return -ENOMEM;
+ /* Now, all elements are owned by strv 'l'. Hence, do not call set_free_free(). */
+ locales = set_free(locales);
+
r = getenv_bool("SYSTEMD_LIST_NON_UTF8_LOCALES");
if (r == -ENXIO || r == 0) {
char **a, **b;