1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-21 16:02:15 +03:00

Fix minor bugs in commit 30bf4689a9 et al.

Coverity complained that the "else" added to fillPGconn() was unreachable,
which it was.  Remove the dead code.  In passing, rearrange the tests so as
not to bother trying to fetch values for options that can't be assigned.

Pre-9.3 did not have that issue, but it did have a "return" that should be
"goto oom_error" to ensure that a suitable error message gets filled in.
This commit is contained in:
Tom Lane
2014-11-30 12:21:01 -05:00
parent 6a694bbab2
commit 85a6ad3cdf

View File

@ -592,7 +592,7 @@ fillPGconn(PGconn *conn, PQconninfoOption *connOptions)
free(conn->sslmode); free(conn->sslmode);
conn->sslmode = strdup("require"); conn->sslmode = strdup("require");
if (!conn->sslmode) if (!conn->sslmode)
return false; goto oom_error;
} }
#endif #endif
#if defined(KRB5) || defined(ENABLE_GSS) || defined(ENABLE_SSPI) #if defined(KRB5) || defined(ENABLE_GSS) || defined(ENABLE_SSPI)
@ -694,7 +694,6 @@ connectOptions2(PGconn *conn)
conn->pgpass = strdup(DefaultPassword); conn->pgpass = strdup(DefaultPassword);
if (!conn->pgpass) if (!conn->pgpass)
goto oom_error; goto oom_error;
} }
else else
conn->dot_pgpass_used = true; conn->dot_pgpass_used = true;