summaryrefslogtreecommitdiffhomepage
path: root/src/acl.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-11-16 01:15:39 +0100
committerMichael Adam <obnox@samba.org>2009-12-07 00:22:46 +0100
commit6266197e9257df1501b1962ad0a3e3ba757092f3 (patch)
tree8b3eacc1566569577ce96ebbda70cf918ce1abfa /src/acl.c
parent2e6999df4aecfa2c32072e556e3e829b54a3a103 (diff)
acl: add function flush_access_list().
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/acl.c b/src/acl.c
index 612d44e..81b6113 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -357,3 +357,27 @@ int check_acl (const char *ip, const char *host)
host, ip);
return 0;
}
+
+void flush_access_list (void)
+{
+ struct acl_s *acl;
+ size_t i;
+
+ if (!access_list) {
+ return;
+ }
+
+ /*
+ * We need to free allocated data hanging off the acl entries
+ * before we can free the acl entries themselves.
+ * A hierarchical memory system would be great...
+ */
+ for (i = 0; i != (size_t) vector_length (access_list); ++i) {
+ acl = (struct acl_s *) vector_getentry (access_list, i, NULL);
+ if (acl->type == ACL_STRING) {
+ safefree (acl->address.string);
+ }
+ }
+
+ vector_delete (access_list);
+}