mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
More code cleanup
This commit is contained in:
@@ -623,7 +623,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
param_set(&source_conninfo, "dbname", runtime_options.dbname);
|
param_set(&source_conninfo, "dbname", runtime_options.dbname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,12 +641,14 @@ main(int argc, char **argv)
|
|||||||
"the data directory.\n"
|
"the data directory.\n"
|
||||||
),
|
),
|
||||||
progname());
|
progname());
|
||||||
exit(1);
|
free_conninfo_params(&source_conninfo);
|
||||||
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exit here already if errors in command line options found */
|
/* Exit here already if errors in command line options found */
|
||||||
if (cli_errors.head != NULL)
|
if (cli_errors.head != NULL)
|
||||||
{
|
{
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
exit_with_cli_errors(&cli_errors);
|
exit_with_cli_errors(&cli_errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -829,6 +831,7 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (cli_errors.head != NULL)
|
if (cli_errors.head != NULL)
|
||||||
{
|
{
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
exit_with_cli_errors(&cli_errors);
|
exit_with_cli_errors(&cli_errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -929,6 +932,8 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (config_file_options.node_id == NODE_NOT_FOUND)
|
if (config_file_options.node_id == NODE_NOT_FOUND)
|
||||||
{
|
{
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
|
|
||||||
log_error(_("no node information was found - please supply a configuration file"));
|
log_error(_("no node information was found - please supply a configuration file"));
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
@@ -967,6 +972,8 @@ main(int argc, char **argv)
|
|||||||
log_error(_("node %i (specified with --node-id) not found"),
|
log_error(_("node %i (specified with --node-id) not found"),
|
||||||
runtime_options.node_id);
|
runtime_options.node_id);
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
|
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -977,6 +984,8 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
log_error(_("unable to escape value provided for --node-name"));
|
log_error(_("unable to escape value provided for --node-name"));
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
|
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -988,6 +997,8 @@ main(int argc, char **argv)
|
|||||||
log_error(_("node %s (specified with --node-name) not found"),
|
log_error(_("node %s (specified with --node-name) not found"),
|
||||||
runtime_options.node_name);
|
runtime_options.node_name);
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
|
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1082,6 +1093,8 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free_conninfo_params(&source_conninfo);
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user