From: Peter Eisentraut Date: Wed, 11 Sep 2019 10:48:27 +0000 (+0200) Subject: Remove dubious const qualifiers X-Git-Tag: pgbouncer_1_12_0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6af258c508c57334f4bd3c410551220a15b88dee;p=pgbouncer Remove dubious const qualifiers These depend on libusual's redefinition of free(), which we should get rid of. see #371 --- diff --git a/include/bouncer.h b/include/bouncer.h index 149a096..f2ed5a7 100644 --- a/include/bouncer.h +++ b/include/bouncer.h @@ -314,7 +314,7 @@ struct PgDatabase { PgUser *forced_user; /* if not NULL, the user/psw is forced */ PgUser *auth_user; /* if not NULL, users not in userlist.txt will be looked up on the server */ - const char *host; /* host or unix socket name */ + char *host; /* host or unix socket name */ int port; int pool_size; /* max server connections in one pool */ @@ -325,7 +325,7 @@ struct PgDatabase { const char *dbname; /* server-side name, pointer to inside startup_msg */ /* startup commands to send to server after connect. malloc-ed */ - const char *connect_query; + char *connect_query; usec_t inactive_time; /* when auto-database became inactive (to kill it after timeout) */ unsigned active_stamp; /* set if autodb has connections */ diff --git a/src/dnslookup.c b/src/dnslookup.c index 885bf3c..9282362 100644 --- a/src/dnslookup.c +++ b/src/dnslookup.c @@ -84,7 +84,7 @@ struct DNSRequest { struct List ucb_list; /* DNSToken->node */ - const char *name; + char *name; int namelen; bool done; @@ -103,7 +103,7 @@ struct DNSZone { struct StatList host_list; /* DNSRequest->znode */ - const char *zonename; + char *zonename; uint32_t serial; }; diff --git a/src/hba.c b/src/hba.c index 6b0b098..88fb680 100644 --- a/src/hba.c +++ b/src/hba.c @@ -411,7 +411,7 @@ static bool parse_names(struct HBAName *hname, struct TokParser *tp, bool is_db, if (tok[0] == '@') { bool ok; - const char *fn; + char *fn; fn = path_join_dirname(parent_filename, tok + 1); if (!fn) return false; diff --git a/src/janitor.c b/src/janitor.c index 189de40..7e5b612 100644 --- a/src/janitor.c +++ b/src/janitor.c @@ -716,7 +716,7 @@ void kill_database(PgDatabase *db) if (db->forced_user) slab_free(user_cache, db->forced_user); if (db->connect_query) - free((void *)db->connect_query); + free(db->connect_query); if (db->inactive_time) { statlist_remove(&autodatabase_idle_list, &db->head); } else {