}
_public_ int sd_get_machine_names(char ***machines) {
- char **l, **a, **b;
+ _cleanup_strv_free_ char **l = NULL;
+ char **a, **b;
int r;
r = get_files_in_directory("/run/systemd/machines/", &l);
*b = NULL;
}
- if (machines)
+ if (machines) {
*machines = l;
+ l = NULL;
+ }
return r;
}