X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Freadconf.c;h=5d14be8111f4c2ba1a1e721e3bdc01bcaad77218;hb=c314dfcd9e33e02f409d86d06045cb6053fe4140;hp=7d1458a0867603b526a01c5c051f1e54a9bd30ce;hpb=ef619222452aa41b843468d66399bbb4e95beda3;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/readconf.c b/src/src/readconf.c index 7d1458a08..5d14be811 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -3011,12 +3011,7 @@ read_named_list(tree_node **anchorp, int *numberp, int max, uschar *s, BOOL forcecache = FALSE; uschar *ss; tree_node *t; -int old_pool = store_pool; -namedlist_block * nb; - -store_pool = POOL_PERM; -nb = store_get(sizeof(namedlist_block), FALSE); -store_pool = old_pool; +namedlist_block * nb = store_get_perm(sizeof(namedlist_block), FALSE); if (Ustrncmp(s, "_cache", 6) == 0) { @@ -3662,12 +3657,7 @@ for (driver_info * dd = drivers_available; dd->driver_name[0] != 0; { int len = dd->options_len; d->info = dd; - { - int old_pool = store_pool; - store_pool = POOL_PERM; - d->options_block = store_get(len, FALSE); - store_pool = old_pool; - } + d->options_block = store_get_perm(len, FALSE); memcpy(d->options_block, dd->options_block, len); for (int i = 0; i < *(dd->options_count); i++) dd->options[i].type &= ~opt_set; @@ -3683,6 +3673,16 @@ return NULL; /* never obeyed */ +static void +driver_init_fini(driver_instance * d, const uschar * class) +{ +if (!d->driver_name) + log_write(0, LOG_PANIC_DIE|LOG_CONFIG, + "no driver defined for %s \"%s\"", class, d->name); +(d->info->init)(d); +} + + /************************************************* * Initialize driver list * *************************************************/ @@ -3743,11 +3743,8 @@ while ((buffer = get_config_line())) { if (d) { - if (!d->driver_name) - log_write(0, LOG_PANIC_DIE|LOG_CONFIG, - "no driver defined for %s \"%s\"", class, d->name); /* s is using big_buffer, so this call had better not */ - (d->info->init)(d); + driver_init_fini(d, class); d = NULL; } if (!macro_read_assignment(buffer)) exim_exit(EXIT_FAILURE); @@ -3763,12 +3760,7 @@ while ((buffer = get_config_line())) /* Finish off initializing the previous driver. */ if (d) - { - if (!d->driver_name) - log_write(0, LOG_PANIC_DIE|LOG_CONFIG, - "no driver defined for %s \"%s\"", class, d->name); - (d->info->init)(d); - } + driver_init_fini(d, class); /* Check that we haven't already got a driver of this name */ @@ -3780,12 +3772,7 @@ while ((buffer = get_config_line())) /* Set up a new driver instance data block on the chain, with its default values installed. */ - { - int old_pool = store_pool; - if (Ustrncmp(class, "router", 7) == 0) store_pool = POOL_PERM; - d = store_get(instance_size, FALSE); - store_pool = old_pool; - } + d = store_get_perm(instance_size, FALSE); memcpy(d, instance_default, instance_size); *p = d; p = &d->next; @@ -3837,12 +3824,7 @@ while ((buffer = get_config_line())) /* Run the initialization function for the final driver. */ if (d) - { - if (!d->driver_name) - log_write(0, LOG_PANIC_DIE|LOG_CONFIG, - "no driver defined for %s \"%s\"", class, d->name); - (d->info->init)(d); - } + driver_init_fini(d, class); } @@ -4275,7 +4257,7 @@ while(acl_line) if (*p != ':' || name[0] == 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "missing or malformed ACL name"); - node = store_get(sizeof(tree_node) + Ustrlen(name), is_tainted(name)); + node = store_get_perm(sizeof(tree_node) + Ustrlen(name), is_tainted(name)); Ustrcpy(node->name, name); if (!tree_insertnode(&acl_anchor, node)) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN,