aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-10-02 15:35:10 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-10-02 15:35:48 -0400
commita563d941803535dbd27d4191fe7729497b7fdf31 (patch)
tree79048d522a1b35451381970fcec821e18f3cf0ab /src/bin/psql/command.c
parent779f80b75d448d61cf3388645505c9fd81000bb2 (diff)
downloadpostgresql-a563d941803535dbd27d4191fe7729497b7fdf31.tar.gz
postgresql-a563d941803535dbd27d4191fe7729497b7fdf31.zip
Standardize naming of malloc/realloc/strdup wrapper functions.
We had a number of variants on the theme of "malloc or die", with the majority named like "pg_malloc", but by no means all. Standardize on the names pg_malloc, pg_malloc0, pg_realloc, pg_strdup. Get rid of pg_calloc entirely in favor of using pg_malloc0. This is an essentially cosmetic change, so no back-patch. (I did find a couple of places where psql and pg_dump were using plain malloc or strdup instead of the pg_ versions, but they don't look significant enough to bother back-patching.)
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b90d2f12b9b..8ccd00d75f7 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1472,7 +1472,7 @@ prompt_for_password(const char *username)
{
char *prompt_text;
- prompt_text = malloc(strlen(username) + 100);
+ prompt_text = pg_malloc(strlen(username) + 100);
snprintf(prompt_text, strlen(username) + 100,
_("Password for user %s: "), username);
result = simple_prompt(prompt_text, 100, false);
@@ -1549,7 +1549,7 @@ do_connect(char *dbname, char *user, char *host, char *port)
}
else if (o_conn && user && strcmp(PQuser(o_conn), user) == 0)
{
- password = strdup(PQpass(o_conn));
+ password = pg_strdup(PQpass(o_conn));
}
while (true)