repmgrd: prevent segfault if no configfile provided

This commit is contained in:
Ian Barwick
2017-07-31 12:54:01 +09:00
parent fbe74cbee4
commit d00cb63179

View File

@@ -52,7 +52,7 @@ load_config(const char *config_file, bool verbose, bool terse, t_configuration_o
* provides a configuration file, they'll want to make sure it's
* used and not fall back to any of the defaults.
*/
if (config_file[0])
if (config_file != NULL && config_file[0] != '\0')
{
strncpy(config_file_path, config_file, MAXPGPATH);
canonicalize_path(config_file_path);