chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
machined: sync to /run after job completed
[elogind.git]
/
src
/
core
/
unit.c
diff --git
a/src/core/unit.c
b/src/core/unit.c
index 991111ab31facaad6fcf4c8f9e29f7ca41e3986e..acc575b6e0adc1691d4bed568f745a8d18dc8183 100644
(file)
--- 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;