src/server/config/keyfile.c

changeset 576
5c31cc844c68
parent 575
bbca8e94fa67
child 579
e10457d74fe1
--- a/src/server/config/keyfile.c	Fri Jan 31 21:01:48 2025 +0100
+++ b/src/server/config/keyfile.c	Fri Jan 31 21:27:54 2025 +0100
@@ -49,6 +49,8 @@
     int r = cfg_parse_basic_file((ConfigParser*)conf, in);
     if(r != 0) {
         fclose(in);
+        cxMempoolDestroy(conf->parser.mp);
+        free(conf->file);
         free(conf);
         // TODO: free
         return NULL;
@@ -60,19 +62,14 @@
 }
 
 void free_keyfile_config(KeyfileConfig *conf) {
-    /*
-    if(conf->users) {
-        ucx_list_free_a(conf->parser.mp, conf->users);
-    }
-    ucx_mempool_destroy(conf->parser.mp->pool);
-    */
+    cxMempoolDestroy(conf->parser.mp);
     free(conf->file);
     free(conf);
 }
 
 int keyfile_parse(void *p, ConfigLine *begin, ConfigLine *end, cxmutstr line) {
     KeyfileConfig *conf = p;
-    CxAllocator *mp = conf->parser.mp;
+    CxAllocator *mp = conf->parser.a;
     
     cxstring *tk = NULL;
     ssize_t tkn = cx_strsplit_a(mp, cx_strcast(line), cx_strn(";", 1), KEYFILE_MAX_TOKENS, &tk);

mercurial