In repmgrd there was the same problem that cause the segfault

This commit is contained in:
Jaime Casanova
2010-10-21 17:58:17 -05:00
parent 7ddc80ea92
commit e3d1580d76
2 changed files with 4 additions and 1 deletions

View File

@@ -208,7 +208,7 @@ main(int argc, char **argv)
if (config_file == NULL)
{
config_file = malloc(10 + sizeof(CONFIG_FILE));
config_file = malloc(5 + sizeof(CONFIG_FILE));
sprintf(config_file, "./%s", CONFIG_FILE);
}

View File

@@ -118,7 +118,10 @@ main(int argc, char **argv)
setup_cancel_handler();
if (config_file == NULL)
{
config_file = malloc(5 + sizeof(CONFIG_FILE));
sprintf(config_file, "./%s", CONFIG_FILE);
}
/*
* Read the configuration file: repmgr.conf