Skip to content

Commit

Permalink
Merge pull request jedisct1#159 from pkrul/master
Browse files Browse the repository at this point in the history
Define escaped_port in pw_pgsql_connect()
  • Loading branch information
jedisct1 authored Nov 23, 2021
2 parents 6587c6d + 4019168 commit 09b36ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/log_pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ static int pw_pgsql_connect(PGconn ** const id_sql_server)
char *conninfo = NULL;
size_t sizeof_conninfo;
char *escaped_server = NULL;
char *escaped_port = NULL;
char *escaped_db = NULL;
char *escaped_user = NULL;
char *escaped_pw = NULL;
Expand All @@ -277,6 +278,7 @@ static int pw_pgsql_connect(PGconn ** const id_sql_server)
*id_sql_server = NULL;

if ((escaped_server = pw_pgsql_escape_conninfo(server)) == NULL ||
(escaped_port = pw_pgsql_escape_conninfo(port)) == NULL ||
(escaped_db = pw_pgsql_escape_conninfo(db)) == NULL ||
(escaped_user = pw_pgsql_escape_conninfo(user)) == NULL ||
(escaped_pw = pw_pgsql_escape_conninfo(pw)) == NULL) {
Expand Down Expand Up @@ -312,6 +314,7 @@ static int pw_pgsql_connect(PGconn ** const id_sql_server)
bye:
free(conninfo);
free(escaped_server);
free(escaped_port);
free(escaped_db);
free(escaped_user);
free(escaped_pw);
Expand Down

0 comments on commit 09b36ea

Please sign in to comment.