]> granicus.if.org Git - pgbouncer/commitdiff
Remove dubious const qualifiers
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 10:48:27 +0000 (12:48 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 10:48:27 +0000 (12:48 +0200)
These depend on libusual's redefinition of free(), which we should get
rid of.

see #371

include/bouncer.h
src/dnslookup.c
src/hba.c
src/janitor.c

index 149a0967930babda98adfdb2c47c3b86fb1cee69..f2ed5a7be244ea1b80364b1fb93d2c770c397d31 100644 (file)
@@ -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 */
index 885bf3c5d3cdb5c3d16efa616b4e241e43490a23..9282362c0da3dc1d27ca86fa7bbd0574b038ba55 100644 (file)
@@ -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;
 };
 
index 6b0b098a98fb414cdb035292b9d154809e960915..88fb680aca3b5914e28e690cb0281120d6424f99 100644 (file)
--- 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;
index 189de409358532d7ba037ebf1c6ea42086317539..7e5b612c45a440cfda53e36e661531ea8fe8a960 100644 (file)
@@ -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 {