src/server/daemon/ldap_auth.c

changeset 385
a1f4cb076d2f
parent 256
19259b6c5cf7
child 415
d938228c382e
--- a/src/server/daemon/ldap_auth.c	Tue Aug 13 22:14:32 2019 +0200
+++ b/src/server/daemon/ldap_auth.c	Sat Sep 24 16:26:10 2022 +0200
@@ -47,9 +47,9 @@
 #endif
 }
 
-AuthDB* create_ldap_authdb(char *name, LDAPConfig *conf) {
-    LDAPAuthDB *authdb = malloc(sizeof(LDAPAuthDB));
-    authdb->authdb.name = strdup(name);
+AuthDB* create_ldap_authdb(ServerConfiguration *cfg, const char *name, LDAPConfig *conf) {
+    LDAPAuthDB *authdb = almalloc(cfg->a, sizeof(LDAPAuthDB));
+    authdb->authdb.name = pool_strdup(cfg->pool, name);
     authdb->authdb.get_user = ldap_get_user;
     authdb->authdb.use_cache = 1;
     authdb->config = *conf;
@@ -64,7 +64,7 @@
     // initialize group cache
     authdb->groups.first = NULL;
     authdb->groups.last = NULL;
-    authdb->groups.map = ucx_map_new(32);
+    authdb->groups.map = ucx_map_new_a(cfg->a, 32);
 
     return (AuthDB*) authdb;
 }

mercurial