mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
In our source code, make a copy of getopt's 'optarg' string arguments,
rather than just storing a pointer.
This commit is contained in:
@@ -65,13 +65,13 @@ main(int argc, char *argv[])
|
||||
listlangs = true;
|
||||
break;
|
||||
case 'h':
|
||||
host = optarg;
|
||||
host = pg_strdup(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
port = optarg;
|
||||
port = pg_strdup(optarg);
|
||||
break;
|
||||
case 'U':
|
||||
username = optarg;
|
||||
username = pg_strdup(optarg);
|
||||
break;
|
||||
case 'w':
|
||||
prompt_password = TRI_NO;
|
||||
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
|
||||
prompt_password = TRI_YES;
|
||||
break;
|
||||
case 'd':
|
||||
dbname = optarg;
|
||||
dbname = pg_strdup(optarg);
|
||||
break;
|
||||
case 'e':
|
||||
echo = true;
|
||||
|
Reference in New Issue
Block a user