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
@@ -437,15 +437,18 @@ free_conninfo_params(t_conninfo_param_list *param_list)
|
||||
|
||||
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]);
|
||||
|
||||
if (param_list->values[c] != NULL)
|
||||
if (param_list->values != NULL && param_list->values[c] != NULL)
|
||||
pfree(param_list->values[c]);
|
||||
}
|
||||
|
||||
pfree(param_list->keywords);
|
||||
pfree(param_list->values);
|
||||
if (param_list->keywords != NULL)
|
||||
pfree(param_list->keywords);
|
||||
|
||||
if (param_list->values != NULL)
|
||||
pfree(param_list->values);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1150,7 +1150,7 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length)
|
||||
}
|
||||
else
|
||||
{
|
||||
t_conninfo_param_list remote_conninfo;
|
||||
t_conninfo_param_list remote_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||
char *host = NULL;
|
||||
PQExpBufferData quoted_command;
|
||||
|
||||
|
||||
@@ -922,7 +922,7 @@ do_node_check_replication_connection(void)
|
||||
PGconn *repl_conn = NULL;
|
||||
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ static bool upstream_conninfo_found = false;
|
||||
static int upstream_node_id = UNKNOWN_NODE_ID;
|
||||
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 upstream_repluser[NAMEDATALEN] = "";
|
||||
|
||||
@@ -1678,7 +1678,7 @@ do_standby_follow(void)
|
||||
int follow_error_code = SUCCESS;
|
||||
|
||||
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;
|
||||
t_system_identification primary_identification = T_SYSTEM_IDENTIFICATION_INITIALIZER;
|
||||
|
||||
@@ -1979,7 +1979,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);
|
||||
|
||||
{
|
||||
t_conninfo_param_list local_node_conninfo;
|
||||
t_conninfo_param_list local_node_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||
bool parse_success;
|
||||
|
||||
initialize_conninfo_params(&local_node_conninfo, false);
|
||||
@@ -3932,7 +3932,7 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *node_in
|
||||
int min_replication_connections = 1,
|
||||
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
|
||||
@@ -5374,7 +5374,7 @@ write_primary_conninfo(char *line, t_conninfo_param_list *param_list)
|
||||
bool password_provided = false;
|
||||
int c;
|
||||
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);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ t_runtime_options runtime_options = T_RUNTIME_OPTIONS_INITIALIZER;
|
||||
t_configuration_options config_file_options = T_CONFIGURATION_OPTIONS_INITIALIZER;
|
||||
|
||||
/* 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;
|
||||
char pg_bindir[MAXLEN] = "";
|
||||
@@ -94,7 +94,7 @@ static ItemList cli_warnings = {NULL, NULL};
|
||||
int
|
||||
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 c;
|
||||
|
||||
Reference in New Issue
Block a user