pgpool2.git / summary / log / commit / refs

commit    655caa9c179de610d39e8a224c5cfaa9558d554d
Author:   Muhammad Usama <m.usama@gmail.com>
Date:     Tue May 24 19:20:53 2016 +0000

    Fixing coverity scan reported issues.
    
    The commit also contains a small fix to get rid of the annoying unconditional
    debug message gets printed at the pgpool startup.


src/config/pool_config_variables.c | 10 +++++++++- src/context/pool_session_context.c | 2 +- src/watchdog/wd_lifecheck.c | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c index 35d37ffbe..2eff501c5 100644 --- a/src/config/pool_config_variables.c +++ b/src/config/pool_config_variables.c @@ -2212,6 +2212,13 @@ InitializeConfigOptions(void) { int i; + /* + * Before we do anything set the log_min_messages to ERROR. + * Reason for doing that is before the log_min_messages gets initialized + * with the actual value the pgpool-II log should not get flooded by DEBUG + * messages + */ + g_pool_config.log_min_messages = ERROR; build_config_variables(); /* @@ -2929,6 +2936,7 @@ setConfigOptionVar(struct config_generic *record, const char* name, int index_va else conf->reset_val = NULL; } + /* save the string value */ if (conf->current_val) pfree(conf->current_val); @@ -3326,7 +3334,7 @@ static bool HBDestinationAssignFunc (ConfigContext context, char* newval, int in g_pool_config.hb_if[index].addr[0] = '\0'; else strlcpy(g_pool_config.hb_if[index].addr, newval, WD_MAX_HOST_NAMELEN -1); - return true; + return true; } /*heartbeat_destination_port*/ diff --git a/src/context/pool_session_context.c b/src/context/pool_session_context.c index 733d98ea5..af5dd29a0 100644 --- a/src/context/pool_session_context.c +++ b/src/context/pool_session_context.c @@ -433,7 +433,7 @@ void pool_clear_sent_message_list(void) static void dump_sent_message(char *caller, POOL_SENT_MESSAGE *m) { ereport(DEBUG1, - (errmsg("called by %s: sent message: address: %x kind: %c name: =%s=", caller, m, m->kind, m->name))); + (errmsg("called by %s: sent message: address: %p kind: %c name: =%s=", caller, m, m->kind, m->name))); } /* diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index 4cf4d7ef1..b34f08b9a 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -1022,12 +1022,13 @@ static void wd_initialize_trusted_servers_list(void) WdUpstreamConnectionData* server = palloc(sizeof(WdUpstreamConnectionData)); server->pid = 0; server->reachable = false; - server->hostname = token; + server->hostname = pstrdup(token); g_trusted_server_list = lappend(g_trusted_server_list,server); ereport(LOG, (errmsg("watchdog lifecheck trusted server \"%s\" added for the availability check",token))); } + pfree(tmpString); MemoryContextSwitchTo(oldCxt); } [parent: 69d3faef7787]