Also, properly remove cgroup path from hashmap when freeing unit.
if (u->in_cgroup_queue)
LIST_REMOVE(Unit, cgroup_queue, u->manager->cgroup_queue, u);
if (u->in_cgroup_queue)
LIST_REMOVE(Unit, cgroup_queue, u->manager->cgroup_queue, u);
+ if (u->cgroup_path) {
+ hashmap_remove(u->manager->cgroup_unit, u->cgroup_path);
+ free(u->cgroup_path);
+ }
+
free(u->description);
strv_free(u->documentation);
free(u->fragment_path);
free(u->description);
strv_free(u->documentation);
free(u->fragment_path);
free(u->cgroup_path);
u->cgroup_path = s;
free(u->cgroup_path);
u->cgroup_path = s;
+
+ hashmap_put(u->manager->cgroup_unit, s, u);