mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Always initialise t_conninfo_param_list structures
This commit is contained in:
11
dbutils.c
11
dbutils.c
@@ -421,15 +421,18 @@ free_conninfo_params(t_conninfo_param_list *param_list)
|
|||||||
|
|
||||||
for (c = 0; c < param_list->size; c++)
|
for (c = 0; c < param_list->size; c++)
|
||||||
{
|
{
|
||||||
if (param_list->keywords[c] != NULL)
|
if (param_list->keywords != NULL && param_list->keywords[c] != NULL)
|
||||||
pfree(param_list->keywords[c]);
|
pfree(param_list->keywords[c]);
|
||||||
|
|
||||||
if (param_list->values[c] != NULL)
|
if (param_list->values != NULL && param_list->values[c] != NULL)
|
||||||
pfree(param_list->values[c]);
|
pfree(param_list->values[c]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pfree(param_list->keywords);
|
if (param_list->keywords != NULL)
|
||||||
pfree(param_list->values);
|
pfree(param_list->keywords);
|
||||||
|
|
||||||
|
if (param_list->values != NULL)
|
||||||
|
pfree(param_list->values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1148,7 +1148,7 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
t_conninfo_param_list remote_conninfo;
|
t_conninfo_param_list remote_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
char *host = NULL;
|
char *host = NULL;
|
||||||
PQExpBufferData quoted_command;
|
PQExpBufferData quoted_command;
|
||||||
|
|
||||||
|
|||||||
@@ -924,7 +924,7 @@ do_node_check_replication_connection(void)
|
|||||||
PGconn *repl_conn = NULL;
|
PGconn *repl_conn = NULL;
|
||||||
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
||||||
RecordStatus record_status = RECORD_NOT_FOUND;
|
RecordStatus record_status = RECORD_NOT_FOUND;
|
||||||
t_conninfo_param_list remote_conninfo;
|
t_conninfo_param_list remote_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
PQExpBufferData output;
|
PQExpBufferData output;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ static bool upstream_conninfo_found = false;
|
|||||||
static int upstream_node_id = UNKNOWN_NODE_ID;
|
static int upstream_node_id = UNKNOWN_NODE_ID;
|
||||||
static char upstream_data_directory[MAXPGPATH];
|
static char upstream_data_directory[MAXPGPATH];
|
||||||
|
|
||||||
static t_conninfo_param_list recovery_conninfo;
|
static t_conninfo_param_list recovery_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
static char recovery_conninfo_str[MAXLEN] = "";
|
static char recovery_conninfo_str[MAXLEN] = "";
|
||||||
static char upstream_repluser[NAMEDATALEN] = "";
|
static char upstream_repluser[NAMEDATALEN] = "";
|
||||||
|
|
||||||
@@ -2028,7 +2028,7 @@ do_standby_follow(void)
|
|||||||
int follow_error_code = SUCCESS;
|
int follow_error_code = SUCCESS;
|
||||||
|
|
||||||
uint64 local_system_identifier = UNKNOWN_SYSTEM_IDENTIFIER;
|
uint64 local_system_identifier = UNKNOWN_SYSTEM_IDENTIFIER;
|
||||||
t_conninfo_param_list repl_conninfo;
|
t_conninfo_param_list repl_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
PGconn *repl_conn = NULL;
|
PGconn *repl_conn = NULL;
|
||||||
t_system_identification primary_identification = T_SYSTEM_IDENTIFICATION_INITIALIZER;
|
t_system_identification primary_identification = T_SYSTEM_IDENTIFICATION_INITIALIZER;
|
||||||
|
|
||||||
@@ -2320,7 +2320,7 @@ do_standby_follow_internal(PGconn *primary_conn, t_node_info *primary_node_recor
|
|||||||
parse_conninfo_string(primary_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
parse_conninfo_string(primary_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
||||||
|
|
||||||
{
|
{
|
||||||
t_conninfo_param_list local_node_conninfo;
|
t_conninfo_param_list local_node_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
bool parse_success;
|
bool parse_success;
|
||||||
|
|
||||||
initialize_conninfo_params(&local_node_conninfo, false);
|
initialize_conninfo_params(&local_node_conninfo, false);
|
||||||
@@ -4315,7 +4315,7 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *node_in
|
|||||||
int min_replication_connections = 1,
|
int min_replication_connections = 1,
|
||||||
possible_replication_connections = 0;
|
possible_replication_connections = 0;
|
||||||
|
|
||||||
t_conninfo_param_list repl_conninfo;
|
t_conninfo_param_list repl_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make a copy of the connection parameter arrays, and append
|
* Make a copy of the connection parameter arrays, and append
|
||||||
@@ -5850,7 +5850,7 @@ write_primary_conninfo(PQExpBufferData *dest, t_conninfo_param_list *param_list)
|
|||||||
bool password_provided = false;
|
bool password_provided = false;
|
||||||
int c;
|
int c;
|
||||||
char *escaped = NULL;
|
char *escaped = NULL;
|
||||||
t_conninfo_param_list env_conninfo;
|
t_conninfo_param_list env_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
|
|
||||||
initialize_conninfo_params(&env_conninfo, true);
|
initialize_conninfo_params(&env_conninfo, true);
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ t_runtime_options runtime_options = T_RUNTIME_OPTIONS_INITIALIZER;
|
|||||||
t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER;
|
t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER;
|
||||||
|
|
||||||
/* conninfo params for the node we're operating on */
|
/* conninfo params for the node we're operating on */
|
||||||
t_conninfo_param_list source_conninfo;
|
t_conninfo_param_list source_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
|
|
||||||
bool config_file_required = true;
|
bool config_file_required = true;
|
||||||
char pg_bindir[MAXLEN] = "";
|
char pg_bindir[MAXLEN] = "";
|
||||||
@@ -96,7 +96,7 @@ static bool _local_command(const char *command, PQExpBufferData *outputbuf, bool
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
t_conninfo_param_list default_conninfo;
|
t_conninfo_param_list default_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||||
|
|
||||||
int optindex;
|
int optindex;
|
||||||
int c;
|
int c;
|
||||||
|
|||||||
Reference in New Issue
Block a user