From ce0f7c97d2302c73832034aac1107e2378c2eeed Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 27 Jun 2011 23:20:56 +0200 Subject: [PATCH] logind: fix ACL code allocation --- src/logind-acl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/logind-acl.c b/src/logind-acl.c index 3df104ff..5ea68185 100644 --- a/src/logind-acl.c +++ b/src/logind-acl.c @@ -54,7 +54,7 @@ static int find_acl(acl_t acl, uid_t uid, acl_entry_t *entry) { return -errno; b = *u == uid; - free(u); + acl_free(u); if (b) { *entry = i; @@ -262,14 +262,15 @@ int devnode_acl_all(struct udev *udev, } node = udev_device_get_devnode(d); - udev_device_unref(d); - if (!node) { + udev_device_unref(d); r = -ENOMEM; goto finish; } r = devnode_acl(node, flush, del, old_uid, add, new_uid); + udev_device_unref(d); + if (r < 0) goto finish; } -- 2.39.5