idmap_rfc2307: Slightly simplify idmap_rfc2307_initialize()
authorVolker Lendecke <vl@samba.org>
Tue, 21 Mar 2017 14:52:37 +0000 (15:52 +0100)
committerUri Simchoni <uri@samba.org>
Wed, 22 Mar 2017 06:11:10 +0000 (07:11 +0100)
Replace an "else" branch with an early "goto err"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/winbindd/idmap_rfc2307.c

index 340757a55da1683fe280c870133d316b64e92a22..8ee84f7106c534aaa3eee5fed8438f1248f8b00d 100644 (file)
@@ -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);