Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 50fe7c3

Browse files
committed
Allocate password for simple_prompt() for Pg 10
1 parent 688747f commit 50fe7c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/utils/pgut.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const char *pgut_dbname = NULL;
3838
const char *host = NULL;
3939
const char *port = NULL;
4040
const char *username = NULL;
41-
char *password = NULL;
41+
static char *password = NULL;
4242
bool prompt_password = true;
4343

4444
/* Database connections */
@@ -1086,6 +1086,7 @@ prompt_for_password(const char *username)
10861086
}
10871087

10881088
#if PG_VERSION_NUM >= 100000
1089+
password = (char *) pgut_malloc(sizeof(char) * 100 + 1);
10891090
if (username == NULL)
10901091
simple_prompt("Password: ", password, 100, false);
10911092
else

src/utils/pgut.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ extern const char *pgut_dbname;
101101
extern const char *host;
102102
extern const char *port;
103103
extern const char *username;
104-
extern char *password;
105104
extern bool prompt_password;
106105

107106
extern bool interrupted;

0 commit comments

Comments
 (0)