mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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.
This commit is contained in:
@@ -1645,11 +1645,11 @@ session_username(void)
|
||||
* substitute '~' with HOME or '~username' with username's home dir
|
||||
*
|
||||
*/
|
||||
char *
|
||||
void
|
||||
expand_tilde(char **filename)
|
||||
{
|
||||
if (!filename || !(*filename))
|
||||
return NULL;
|
||||
return;
|
||||
|
||||
/*
|
||||
* WIN32 doesn't use tilde expansion for file names. Also, it uses tilde
|
||||
@@ -1697,5 +1697,5 @@ expand_tilde(char **filename)
|
||||
}
|
||||
#endif
|
||||
|
||||
return *filename;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user