summaryrefslogtreecommitdiff
path: root/src/shared/unit-name.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/unit-name.c')
-rw-r--r--src/shared/unit-name.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 2d4cd8d9f3..0910e86f10 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -455,7 +455,7 @@ char *unit_name_to_path(const char *name) {
}
char *unit_dbus_path_from_name(const char *name) {
- char *e, *p;
+ _cleanup_free_ char *e = NULL;
assert(name);
@@ -463,10 +463,7 @@ char *unit_dbus_path_from_name(const char *name) {
if (!e)
return NULL;
- p = strappend("/org/freedesktop/systemd1/unit/", e);
- free(e);
-
- return p;
+ return strappend("/org/freedesktop/systemd1/unit/", e);
}
char *unit_name_mangle(const char *name) {