diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index a533786f082..66366a5257f 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -815,16 +815,15 @@ CheckPWChallengeAuth(Port *port, char **logdetail) if (shadow_pass) pfree(shadow_pass); - - /* - * If get_role_password() returned error, return error, even if the - * authentication succeeded. - */ - if (!shadow_pass) + else { + /* + * If get_role_password() returned error, authentication better not + * have succeeded. + */ Assert(auth_result != STATUS_OK); - return STATUS_ERROR; } + return auth_result; }