Clean up password prompting logic in streamutil.c.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 3172eea062e779db39df9a48fca0ad7448163f98
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-11-15T22:27:41Z
Releases: 9.4.0
Clean up password prompting logic in streamutil.c.

The previous coding was fairly unreadable and drew double-free warnings
from clang.  I believe the double free was actually not reachable, because
PQconnectionNeedsPassword is coded to not return true if a password was
provided, so that the loop can't iterate more than twice.  Nonetheless
it seems worth rewriting.  No back-patch since this is just cosmetic.

Files

PathChange+/−
src/bin/pg_basebackup/streamutil.c modified +56 −54