psql: fix startup crash caused by PSQLRC containing a tilde

Bruce Momjian <bruce@momjian.us>

Commit: 39d4c764da3d4dd74238d82b0e5ccd1030ebf9f7
Author: Bruce Momjian <bruce@momjian.us>
Date: 2013-04-04T16:56:25Z
Releases: 9.2.5
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