dsdb: Slightly simplify samdb_check_password
authorVolker Lendecke <vl@samba.org>
Thu, 15 Nov 2018 09:40:50 +0000 (10:40 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 16 Nov 2018 17:35:22 +0000 (18:35 +0100)
Avoid an "else" where we have the early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Baumbach <bbaumbach@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/dsdb/common/util.c

index e7b860df1bc58f4d8d113173ceba46ff9cea7c90..7ce5168c6c777391bd03c6f671d78dd210373cf5 100644 (file)
@@ -2153,17 +2153,16 @@ enum samr_ValidationStatus samdb_check_password(TALLOC_CTX *mem_ctx,
                        DEBUG(0, ("check_password_complexity: check password script took too long!\n"));
                        TALLOC_FREE(password_script);
                        return SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR;
-               } else {
-                       DEBUG(5,("check_password_complexity: check password script (%s) "
-                                "returned [%d]\n", password_script, check_ret));
-
-                       if (check_ret != 0) {
-                               DEBUG(1,("check_password_complexity: "
-                                        "check password script said new password is not good "
-                                        "enough!\n"));
-                               TALLOC_FREE(password_script);
-                               return SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH;
-                       }
+               }
+               DEBUG(5,("check_password_complexity: check password script (%s) "
+                        "returned [%d]\n", password_script, check_ret));
+
+               if (check_ret != 0) {
+                       DEBUG(1,("check_password_complexity: "
+                                "check password script said new password is not good "
+                                "enough!\n"));
+                       TALLOC_FREE(password_script);
+                       return SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH;
                }
 
                TALLOC_FREE(password_script);