chiark / gitweb /
logind: add infrastructure to keep track of machines, and move to slices
[elogind.git] / src / shared / unit-name.c
index 2d4cd8d9f3743ebee8aaaaadbaff717463ebb793..0910e86f107139affb5b793f7d0002243609484f 100644 (file)
@@ -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) {