From: Volker Lendecke Date: Tue, 21 Mar 2017 14:52:37 +0000 (+0100) Subject: idmap_rfc2307: Slightly simplify idmap_rfc2307_initialize() X-Git-Tag: tdb-1.3.13~411 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8a063b4e64ae4325c4fc229927aaf8319fcbad0;p=thirdparty%2Fsamba.git idmap_rfc2307: Slightly simplify idmap_rfc2307_initialize() Replace an "else" branch with an early "goto err" Signed-off-by: Volker Lendecke Reviewed-by: Uri Simchoni --- diff --git a/source3/winbindd/idmap_rfc2307.c b/source3/winbindd/idmap_rfc2307.c index 340757a55da..8ee84f7106c 100644 --- a/source3/winbindd/idmap_rfc2307.c +++ b/source3/winbindd/idmap_rfc2307.c @@ -774,29 +774,27 @@ static NTSTATUS idmap_rfc2307_initialize(struct idmap_domain *domain) bind_path_user = idmap_config_const_string( domain->name, "bind_path_user", NULL); - if (bind_path_user) { - ctx->bind_path_user = talloc_strdup(ctx, bind_path_user); - if (ctx->bind_path_user == NULL) { - status = NT_STATUS_NO_MEMORY; - goto err; - } - } else { + if (bind_path_user == NULL) { status = NT_STATUS_INVALID_PARAMETER; goto err; } + ctx->bind_path_user = talloc_strdup(ctx, bind_path_user); + if (ctx->bind_path_user == NULL) { + status = NT_STATUS_NO_MEMORY; + goto err; + } bind_path_group = idmap_config_const_string( domain->name, "bind_path_group", NULL); - if (bind_path_group) { - ctx->bind_path_group = talloc_strdup(ctx, bind_path_group); - if (ctx->bind_path_group == NULL) { - status = NT_STATUS_NO_MEMORY; - goto err; - } - } else { + if (bind_path_group == NULL) { status = NT_STATUS_INVALID_PARAMETER; goto err; } + ctx->bind_path_group = talloc_strdup(ctx, bind_path_group); + if (ctx->bind_path_group == NULL) { + status = NT_STATUS_NO_MEMORY; + goto err; + } ldap_server = idmap_config_const_string( domain->name, "ldap_server", NULL);