summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-08-28 15:33:35 +0200
committerHarald Hoyer <harald@redhat.com>2013-08-28 16:02:57 +0200
commitb58b8e11c5f769e3c80d5169fdcc4bd04b882b7d (patch)
treef0ab4e44f8910ae63c9b017736d36bca3ebfe9c1 /src/core/unit.c
parent3d040cf24473f2ed13121d57ed753bad5f8ad09d (diff)
Do not realloc strings, which are already in the hashmap as keys
This prevents corruption of the hashmap, because we would free() the keys in the hashmap, if the unit is already in there, with the same cgroup path.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 27119b0cd7..ab313b9b91 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2329,7 +2329,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
free(u->cgroup_path);
u->cgroup_path = s;
- hashmap_put(u->manager->cgroup_unit, s, u);
+ assert(hashmap_put(u->manager->cgroup_unit, s, u) == 1);
continue;
}