Hashmap *have_installed;
} InstallContext;
-#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
#define _cleanup_install_context_done_ _cleanup_(install_context_done)
static int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope) {
STRV_FOREACH(p, paths.unit_path) {
_cleanup_free_ char *path = NULL, *tmp = NULL;
+ char *n;
if (isempty(root_dir))
path = strappend(*p, "/default.target");
r = readlink_malloc(path, &tmp);
if (r == -ENOENT)
continue;
- else if (r < 0)
+ if (r < 0)
return r;
- *name = strdup(path_get_file_name(tmp));
- if (!*name)
+ n = strdup(path_get_file_name(tmp));
+ if (!n)
return -ENOMEM;
+ *name = n;
return 0;
}