src/server/config/conf.c

changeset 576
5c31cc844c68
parent 453
4586d534f9b5
child 579
e10457d74fe1
--- a/src/server/config/conf.c	Fri Jan 31 21:01:48 2025 +0100
+++ b/src/server/config/conf.c	Fri Jan 31 21:27:54 2025 +0100
@@ -36,7 +36,8 @@
     parser->lines_end = NULL;
     CxMempool *mp = cxBasicMempoolCreate(512);
     CxAllocator *a = (CxAllocator*)mp->allocator;
-    parser->mp = a;
+    parser->a = a;
+    parser->mp = mp;
 
     // one logical line over many lines
     cxmutstr mline;
@@ -51,8 +52,8 @@
         void *org_ptr = l.ptr;
         
         // put the line to the list
-        ConfigLine *line = OBJ_NEW(parser->mp, ConfigLine);
-        line->line = cx_strdup_a(parser->mp, cx_strcast(l)); // TODO: check for 0-len str
+        ConfigLine *line = OBJ_NEW(parser->a, ConfigLine);
+        line->line = cx_strdup_a(parser->a, cx_strcast(l)); // TODO: check for 0-len str
         line->object = NULL;
         line->type = LINE_OTHER;
         CFG_LINE_ADD(&parser->lines_begin, &parser->lines_end, line);
@@ -80,7 +81,7 @@
             }
             if(l.ptr[l.length - 1] == '\\') {
                 if(mline.ptr == NULL) {
-                    mline = cx_strdup_a(parser->mp, cx_strcast(l));
+                    mline = cx_strdup_a(parser->a, cx_strcast(l));
                     start_line = line;
                 }
             } else {

mercurial