Skip to content

Commit c2be18c

Browse files
committed
Fix minor bugs in commit 30bf468 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.
1 parent 168636a commit c2be18c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ fillPGconn(PGconn *conn, PQconninfoOption *connOptions)
643643
free(conn->sslmode);
644644
conn->sslmode = strdup("require");
645645
if (!conn->sslmode)
646-
return false;
646+
goto oom_error;
647647
}
648648
#endif
649649
FILL_CONN_OPTION(conn->requirepeer, "requirepeer");
@@ -746,7 +746,6 @@ connectOptions2(PGconn *conn)
746746
conn->pgpass = strdup(DefaultPassword);
747747
if (!conn->pgpass)
748748
goto oom_error;
749-
750749
}
751750
else
752751
conn->dot_pgpass_used = true;

0 commit comments

Comments
 (0)