summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 991111ab31..acc575b6e0 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -231,8 +231,13 @@ int unit_set_description(Unit *u, const char *description) {
assert(u);
- if (!(s = strdup(description)))
- return -ENOMEM;
+ if (isempty(description))
+ s = NULL;
+ else {
+ s = strdup(description);
+ if (!s)
+ return -ENOMEM;
+ }
free(u->description);
u->description = s;