winbind: Use idmap_config_const_string in idmap_tdb2_db_init
[amitay/samba.git] / source3 / winbindd / idmap_tdb2.c
index fdcd44eb635261408f0ebd1907b9488d9e325f4f..72c5b9e1ad8a3a6ff2c27aed1deda4bc4d4afed7 100644 (file)
@@ -533,7 +533,6 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom)
        NTSTATUS ret;
        struct idmap_tdb_common_context *commonctx;
        struct idmap_tdb2_context *ctx;
-       char *config_option = NULL;
        const char * idmap_script = NULL;
 
        commonctx = talloc_zero(dom, struct idmap_tdb_common_context);
@@ -556,14 +555,7 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom)
                goto failed;
        }
 
-       config_option = talloc_asprintf(ctx, "idmap config %s", dom->name);
-       if (config_option == NULL) {
-               DEBUG(0, ("Out of memory!\n"));
-               ret = NT_STATUS_NO_MEMORY;
-               goto failed;
-       }
-       ctx->script = lp_parm_const_string(-1, config_option, "script", NULL);
-       talloc_free(config_option);
+       ctx->script = idmap_config_const_string(dom->name, "script", NULL);
 
        idmap_script = lp_parm_const_string(-1, "idmap", "script", NULL);
        if (idmap_script != NULL) {