]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/login/logind-user-dbus.c
tree-wide: use TAKE_PTR() and TAKE_FD() macros
[thirdparty/systemd.git] / src / login / logind-user-dbus.c
index 9fca5ce0cda1096d25a59414bae12eea5a15463d..ef1fce8bd1783dd05e47f371a7ba95c118e41d47 100644 (file)
@@ -288,13 +288,13 @@ int user_object_find(sd_bus *bus, const char *path, const char *interface, void
                         return 0;
 
                 r = parse_uid(p, &uid);
-        }
-        if (r < 0)
-                return 0;
+                if (r < 0)
+                        return 0;
 
-        user = hashmap_get(m->users, UID_TO_PTR(uid));
-        if (!user)
-                return 0;
+                user = hashmap_get(m->users, UID_TO_PTR(uid));
+                if (!user)
+                        return 0;
+        }
 
         *found = user;
         return 1;
@@ -354,8 +354,7 @@ int user_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***
                 }
         }
 
-        *nodes = l;
-        l = NULL;
+        *nodes = TAKE_PTR(l);
 
         return 1;
 }