winbind: Use idmap_config_const_string in idmap_script_db_init
authorVolker Lendecke <vl@samba.org>
Sat, 7 Jan 2017 14:55:41 +0000 (14:55 +0000)
committerMichael Adam <obnox@samba.org>
Mon, 20 Mar 2017 18:36:21 +0000 (19:36 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/winbindd/idmap_script.c

index 75eabdf1c007933e73206401b7bf480a09432edf..4faf2d593b658a25e803d4a7605f30f604c3a9db 100644 (file)
@@ -582,7 +582,6 @@ static NTSTATUS idmap_script_db_init(struct idmap_domain *dom)
 {
        NTSTATUS ret;
        struct idmap_script_context *ctx;
-       char *config_option = NULL;
        const char * idmap_script = NULL;
 
        DEBUG(10, ("%s called ...\n", __func__));
@@ -594,14 +593,7 @@ static NTSTATUS idmap_script_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);
 
        /* Do we even need to handle this? */
        idmap_script = lp_parm_const_string(-1, "idmap", "script", NULL);