src/server/plugins/postgresql/config.c

branch
webdav
changeset 376
61d481d3c2e4
parent 374
77506ec632a4
child 415
d938228c382e
--- a/src/server/plugins/postgresql/config.c	Sun Aug 14 12:43:14 2022 +0200
+++ b/src/server/plugins/postgresql/config.c	Sun Aug 14 16:46:52 2022 +0200
@@ -359,31 +359,31 @@
     if(!exttable) return 1;
     exttable->table = tabname;
     exttable->isused = 0; // not relevant in config
+    int tableindex = (int)ucx_list_size(ext->tables);
     ext->tables = ucx_list_append(ext->tables, exttable);
     
     if(ucx_map_cstr_put(ext->table_lookup, table, table)) {
         return 1;
     }
-    
-    int tableindex = (int)ucx_list_size(ext->tables);
+     
     UCX_FOREACH(elm, properties) {
         xmlNode *ps = elm->data;
         const char *value = pg_util_xml_get_text(ps);
         
-        PgPropertyStoreExt *ext = pool_malloc(pool, sizeof(PgPropertyStoreExt));
-        if(!ext) {
+        PgPropertyStoreExt *ext_col = pool_malloc(pool, sizeof(PgPropertyStoreExt));
+        if(!ext_col) {
             return 1;
         }
-        ext->tableindex = tableindex;
-        ext->ns = pool_strdup(pool, (const char*)ps->ns->href);
-        ext->name = pool_strdup(pool, (const char*)ps->name);
-        ext->column = pool_strdup(pool, (const char*)value);
-        if(!ext->ns || !ext->name || !ext->column) {
+        ext_col->tableindex = tableindex;
+        ext_col->ns = pool_strdup(pool, (const char*)ps->ns->href);
+        ext_col->name = pool_strdup(pool, (const char*)ps->name);
+        ext_col->column = pool_strdup(pool, (const char*)value);
+        if(!ext_col->ns || !ext_col->name || !ext_col->column) {
             return 1;
         }
         
-        UcxKey key = webdav_property_key(ext->ns, ext->name);
-        int err = ucx_map_put(repo->prop_ext, key, ext);
+        UcxKey key = webdav_property_key(ext_col->ns, ext_col->name);
+        int err = ucx_map_put(repo->prop_ext, key, ext_col);
         free((void*)key.data);
         if(err) {
             return 1;

mercurial