From: Lennart Poettering Date: Mon, 27 Jun 2011 21:20:56 +0000 (+0200) Subject: logind: fix ACL code allocation X-Git-Tag: v30~133 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce0f7c97d2302c73832034aac1107e2378c2eeed;p=systemd logind: fix ACL code allocation --- 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; }