summaryrefslogtreecommitdiff
path: root/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'unit.c')
-rw-r--r--unit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/unit.c b/unit.c
index 5c19b3b2da..3f2538a694 100644
--- a/unit.c
+++ b/unit.c
@@ -125,6 +125,11 @@ int unit_add_name(Unit *u, const char *text) {
goto fail;
}
+ if (hashmap_size(u->meta.manager->units) >= MANAGER_MAX_NAMES) {
+ r = -E2BIG;
+ goto fail;
+ }
+
if ((r = set_put(u->meta.names, s)) < 0) {
if (r == -EEXIST)
r = 0;