From 8a80712bcd137b78f5edb7b1bf3d210b8df9323f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 1 Sep 2018 23:09:54 +0900 Subject: [PATCH] logind-acl: replace strdup()+set_consume() by set_put_strdup() --- src/login/logind-acl.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c index da197d0..5453ebb 100644 --- a/src/login/logind-acl.c +++ b/src/login/logind-acl.c @@ -206,12 +206,8 @@ int devnode_acl_all(const char *seat, if (sd_device_get_devname(d, &node) < 0) continue; - n = strdup(node); - if (!n) - return -ENOMEM; - - log_debug("Found udev node %s for seat %s", n, seat); - r = set_consume(nodes, n); + log_debug("Found udev node %s for seat %s", node, seat); + r = set_put_strdup(nodes, node); if (r < 0) return r; } -- 2.7.4