Don't try and copy a NULL pointer

This commit is contained in:
Ian Barwick
2017-05-03 08:20:51 +09:00
parent cbc3e1700b
commit 962598259e

View File

@@ -131,7 +131,10 @@ do_master_register(void)
/* update node record structure with settings from config file */
strncpy(node_info.node_name, config_file_options.node_name, MAXLEN);
strncpy(node_info.conninfo, config_file_options.conninfo, MAXLEN);
strncpy(node_info.slot_name, repmgr_slot_name_ptr, MAXLEN);
if (repmgr_slot_name_ptr != NULL)
strncpy(node_info.slot_name, repmgr_slot_name_ptr, MAXLEN);
node_info.priority = config_file_options.priority;
initPQExpBuffer(&event_description);
@@ -168,7 +171,6 @@ do_master_register(void)
}
/* Log the event */
create_event_record(conn,
&config_file_options,