psql: fix startup crash caused by PSQLRC containing a tilde

Bruce Momjian <bruce@momjian.us>

Commit: 48a2cd370e2610f0a196240aed9f5abd82d3dada
Author: Bruce Momjian <bruce@momjian.us>
Date: 2013-04-04T16:56:24Z
Releases: 9.3.0
psql:  fix startup crash caused by PSQLRC containing a tilde

'strdup' the PSQLRC environment variable value before calling a routine
that might free() it.

Backpatch to 9.2, where the bug first appeared.

Files

PathChange+/−
src/bin/psql/common.c modified +3 −3
src/bin/psql/common.h modified +1 −1
src/bin/psql/startup.c modified +6 −5