From d0ac688d180abecd13306a5fd3b31e7f36cbc4a6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Jun 2008 04:51:21 +0200 Subject: [PATCH] Fix memory leak introduced on 2008-05-22. --- ChangeLog | 6 ++++++ lib/set-mode-acl.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6b4b68e56..edce9825d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-06-07 Bruno Haible + Fix memory leak introduced on 2008-05-22. + * lib/set-mode-acl.c (qset_acl) [!MODE_INSIDE_ACL]: Free ACLs after + use. + +2008-06-07 Bruno Haible + * lib/set-mode-acl.c (qset_acl): Use acl_init(), not acl_from_text(), to construct an empty ACL. diff --git a/lib/set-mode-acl.c b/lib/set-mode-acl.c index cf5973865..6780d2393 100644 --- a/lib/set-mode-acl.c +++ b/lib/set-mode-acl.c @@ -153,6 +153,8 @@ qset_acl (char const *name, int desc, mode_t mode) acl = acl_get_file (name, ACL_TYPE_ACCESS); if (acl) { + acl_free (acl); + acl = acl_init (0); if (acl) { @@ -176,6 +178,7 @@ qset_acl (char const *name, int desc, mode_t mode) errno = saved_errno; return -1; } + acl_free (acl); } } -- 2.11.0